File: check_status

package info (click to toggle)
fai 4.3.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 1,740 kB
  • sloc: perl: 5,115; sh: 4,272; makefile: 157
file content (14 lines) | stat: -rwxr-xr-x 240 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /bin/sh

# check_status <command run> <its result status>

cmd=$1
st=$2

if [ $st -eq 0 ]; then
   res="OK."
else
   res="FAILED with exit code $st."
fi
# put result in the log file
printf "%-20s $res\n" $cmd | tee -a $LOGDIR/status.log