Debian Codegraph @

lib/check_status

raw
1 #! /bin/sh
2
3 # check_status <command run> <its result status>
4
5 cmd=$1
6 st=$2
7
8 if [ $st -eq 0 ]; then
9 res="OK."
10 else
11 res="FAILED with exit code $st."
12 fi
13 # put result in the log file
14 printf "%-20s $res\n" $cmd | tee -a $LOGDIR/status.log