check_vpn.sh: some minor changes on script output.

This commit is contained in:
Christoph 2018-03-18 19:40:17 +01:00
parent d58b7cc683
commit 3ce0e5e170

View File

@ -36,34 +36,59 @@ clean_up() {
fatal(){ fatal(){
echo "" echo ""
echo -e " [ Fatal ] $*" if $terminal ; then
echo -e " [ \033[31m\033[1mFatal\033[m ] $*"
else
echo -e " [ Fatal ] $*"
fi
echo "" echo ""
echo -e "\tScript terminated.." if $terminal ; then
echo -e " \033[1mScript terminated\033[m.."
else
echo -e " Script terminated.."
fi
echo "" echo ""
clean_up 1 rm -rf $LOCK_DIR
exit 1
} }
error (){ error (){
echo "" echo ""
echo -e " [ Error ] $*" if $terminal ; then
echo -e " [ \033[31m\033[1mError\033[m ] $*"
else
echo " [ Error ] $*"
fi
echo "" echo ""
} }
warn (){ warn (){
echo "" echo ""
echo -e " [ Warn ] $*" if $terminal ; then
echo -e " [ \033[33m\033[1mWarn\033[m ] $*"
else
echo " [ Warn ] $*"
fi
echo "" echo ""
} }
info (){ info (){
echo "" echo ""
echo -e " [ Info ] $*" if $terminal ; then
echo -e " [ \033[32m\033[1mInfo\033[m ] $*"
else
echo " [ Info ] $*"
fi
echo "" echo ""
} }
ok (){ ok (){
echo "" echo ""
echo -e " [ Ok ] $*" if $terminal ; then
echo -e " [ \033[32m\033[1mOk\033[m ] $*"
else
echo " [ Ok ] $*"
fi
echo "" echo ""
} }