From c924f98508d25028f4f27cc4a35e9478d547e7a2 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 4 Aug 2017 13:35:16 +0200 Subject: [PATCH] Delete 'bind_get_zonefile_by_hostname.sh'. Script was not ready to run, it was a test script.' --- OLD_Versions/bind_get_zonefile_by_hostname.sh | 120 ------------------ 1 file changed, 120 deletions(-) delete mode 100755 OLD_Versions/bind_get_zonefile_by_hostname.sh diff --git a/OLD_Versions/bind_get_zonefile_by_hostname.sh b/OLD_Versions/bind_get_zonefile_by_hostname.sh deleted file mode 100755 index e246471..0000000 --- a/OLD_Versions/bind_get_zonefile_by_hostname.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env bash - -# - Bind configuration file containing zone definitions -# - -ZONE_CONF_FILE=/etc/bind/named.conf.local - -## -- -## -- End: Variable definitions - -## *** -## *** Don't make changes after this line *** -## *** - -## --- some functions -## --- -echononl(){ - echo X\\c > /tmp/shprompt$$ - if [ `wc -c /tmp/shprompt$$ | awk '{print $1}'` -eq 1 ]; then - echo -e -n "$*\\c" 1>&2 - else - echo -e -n "$*" 1>&2 - fi - rm /tmp/shprompt$$ -} - -fatal(){ - echo "" - echo -e "[ \033[31m\033[1mError\033[m ]: $*" - echo "" - echo -e "\t\033[31m\033[1mScript is canceled\033[m\033[m" - echo "" - exit 1 -} - -warn (){ - echo "" - echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*" - echo "" -} - -info (){ - echo "" - echo -e "\t[ \033[32m\033[1mInfo\033[m ]: $*" - echo "" -} - -ok (){ - echo "" - echo -e "\t[ \033[36m\033[1mOk\033[m ]: $*" - echo "" -} - -error(){ - echo "" - echo -e "\t[ \033[31m\033[1mFehler\033[m ]: $*" - echo "" -} - -echo_ok() { - echo -e "\033[75G[ \033[32mok\033[m ]" -} -echo_failed(){ - echo -e "\033[75G[ \033[1;31mfailed\033[m ]" -} -echo_skipped() { - echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" -} - -containsElement () { - local e - for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done - return 1 -} - -## --- -## --- END: functions - -hostname=$1 - - -echo "" - - -# - Validate Syntax of given domain -# - -valid_domain_regex="^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$" -echononl "\tValidate syntax of given domain.." -if [[ $hostname =~ $valid_domain_regex ]]; then - if [[ ! $hostname =~ \. ]]; then - echo_failed - error "Invalid hostname/domain given!" - exit 10 - else - echo_ok - fi -else - echo_failed - error "Invalid hostname/domain given!" - exit 10 -fi - -_failed=false -while ! grep $hostname $ZONE_CONF_FILE > /dev/null 2>&1 ; do - hostname=${hostname#*.} - if [[ ! $hostname =~ \. ]]; then - _failed=true - break - fi -done - -if $_failed ; then - echo "hostname \"$1\" not supported by this nameserver!" -else - domain=$hostname - echo "domain: $domain" -fi - -echo -exit 0 -