Skip to content
Snippets Groups Projects
Select Git revision
  • 0fecb6def974d136168525de050ad754b879eaef
  • master default protected
  • simple-task/7248-eol-check-add-node-22
  • 6877_check_iml_deployment
4 results

zz_test_help.sh

Blame
  • zz_test_help.sh 1.26 KiB
    #!/bin/bash
    cd "$( dirname "$0" )" || exit
    typeset -i iTotal
    
    typeset -i iErr
    typeset -i iWarn
    
    
    # ----------------------------------------------------------------------
    # FUNCTIONS
    # ----------------------------------------------------------------------
    
    function getChecks(){
        grep "inc_pluginfunctions" * 2>/dev/null | cut -f 1 -d ":" | grep -vE "^(zz_|inc)"
    }
    
    # ----------------------------------------------------------------------
    # MAIN
    # ----------------------------------------------------------------------
    
    iTotal=$( getChecks | wc -l )
    echo
    echo "CHECK IML CHECKS - $( date )"
    echo
    for check in $( getChecks )
    do
        if ./$check -h 2>/dev/null| grep -q "https://os-docs.iml.unibe.ch"; then
            # echo "✅ OK $check"
            url=$( ./$check -h | grep "https://os-docs.iml.unibe.ch" )
            if curl -sI $url | grep -q "200 OK"; then
                echo "✅ OK   : $check"
            else
                echo "⚠️ WARN : $check - $url"
                iWarn+=1
            fi
        else
            echo "❌ ERROR: $check"
            iErr+=1
            # ./$check -h
        fi 
    done
    
    echo
    echo "---- Total   : $iTotal"
    echo "  Errors     : $iErr checks with wrong help"
    echo "  Warnings   : $iWarn checks with wrong url"
    echo
    # ----------------------------------------------------------------------