Add Parameter 'check' to test accessibility.

This commit is contained in:
Christoph 2017-08-06 14:00:30 +02:00
parent 67f2cf49ea
commit f7a22e4001

View File

@ -89,15 +89,17 @@ fatal(){
}
info (){
echo ""
if $terminal && $LOGGING ; then
echo ""
echo -e "\t[ \033[32m\033[1mInfo\033[m ]: $*"
echo ""
else
if $LOGGING ; then
echo ""
echo "Info: $*"
echo ""
fi
fi
echo ""
}
warn (){
@ -187,6 +189,17 @@ while getopts d:hq opt ; do
esac
done
shift $(expr $OPTIND - 1)
# - Parameter "check" can be used, to test whether this script
# - is accessable (e.g. from a script on a remote host)
# -
if [[ "$1" = "check" ]]; then
info "Script \033[1m$(basename $0)\033[m was successfully invoked, but its only a test."
clean_up 0
fi
if ! $LOGGING && [[ -z "$DOMAIN_REQUESTED_TO_REMOVE" ]] ; then
usage "Giving Domain for deletion (option '-d') is required if using option '-q'."
fi