From f7a22e400169f43ae53dc1aaba25405bd071eb8c Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 6 Aug 2017 14:00:30 +0200 Subject: [PATCH] Add Parameter 'check' to test accessibility. --- bind_remove_domain.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bind_remove_domain.sh b/bind_remove_domain.sh index fada8b9..5f10edd 100755 --- a/bind_remove_domain.sh +++ b/bind_remove_domain.sh @@ -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