[kvmstats] add error function
continuous-integration/drone/push Build encountered an error
Details
continuous-integration/drone/push Build encountered an error
Details
This commit is contained in:
parent
501c5134d4
commit
a4a7eda8e2
11
kvmstats
11
kvmstats
|
@ -2,6 +2,11 @@
|
|||
|
||||
set -e
|
||||
|
||||
error () {
|
||||
echo "$0": "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
usage () {
|
||||
echo 'usage: kvmstats [-a] [-u k|m|g]' >&2
|
||||
exit 1
|
||||
|
@ -9,11 +14,7 @@ usage () {
|
|||
|
||||
for DEP in bc virsh
|
||||
do
|
||||
if [ -z "$(which $DEP)" ]
|
||||
then
|
||||
echo "kvmstats: $DEP not found in \$PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
command -v $DEP > /dev/null || error $DEP command not found
|
||||
done
|
||||
|
||||
POW=$(echo 1024 ^ 3 | bc)
|
||||
|
|
Loading…
Reference in New Issue