--- a/mkdomain Tue Jun 29 09:54:44 2010 +0200
+++ b/mkdomain Wed Jun 30 13:15:11 2010 +0200
@@ -12,7 +12,6 @@
exit
fi
-
customer="$1"; shift
start=$(date -I)
@@ -20,21 +19,29 @@
source dnstools.conf
secondary=$SECONDARY
-secondary_ip=${secondary_ip=$(dig +short $secondary)}
+secondary_ip=${SECONDARY_IP:-$(dig +short $secondary)}
this_host=${THIS_HOST:-$(hostname -f)}
this_ip=${THIS_IP:-$(hostname -i)}
this_domain=${THIS_DOMAIN:-$(hostname -d)}
primary=${PRIMARY:-$this_host}
-hostmaster=${hostmaster="hostmaster.$this_domain"}
+hostmaster=${HOSTMASTER:-"hostmaster.$this_domain"}
+
+zone_conf_dir=${ZONE_CONF_DIR:-/etc/bind/zones.d}
+master_dir=${MASTER_DIR:-/etc/bind/master}
-primary_dir=${primary_dir=/etc/bind/zones.d}
-master_dir=${master_dir=/etc/bind/master}
+if [ ! -d $master_dir ]
+then
+ echo $master_dir nicht gefunden
+ exit 1
+fi
-test -d $primary_dir || mkdir $primary_dir
-test -d $master_dir || mkdir $master_dir
-
+if [ ! -d $zone_conf_dir ]
+then
+ echo $zone_conf_dir nicht gefunden
+ exit 1
+fi
# debug option
if test $opt_debug; then
@@ -44,7 +51,7 @@
primary: $primary
secondary: $secondary [$secondary_ip]
hostmaster: $hostmaster
-primary directory: $primary_dir
+zone config directory: $zone_conf_dir
xxx
exit
fi
@@ -55,7 +62,7 @@
test -d $master_dir/$domain || mkdir $master_dir/$domain
zonefile=$master_dir/$domain/$domain
- config=$primary_dir/$domain
+ config=$zone_conf_dir/$domain
echo "$domain ($utf8domain)"