-if [ -e /etc/bind/named.conf.options ]; then
- lameconf=$(awk '/^logging/,/^}/ { if ($0 ~ /category lame-servers/) { print "yes"; exit } }' /etc/bind/named.conf)
- if [ "x$lameconf" != "xyes" ]; then
- cp /etc/bind/named.conf.options /etc/bind/named.conf.options.$$
- cp-update bind9-cn /etc/bind/named.conf.options.$$ <<EOF
+script='/^logging/,/^}/ { if ($0 ~ /category lame-servers/) { print "yes"; exit } }'
+lameconf=
+if [ -e /etc/bind/named.conf.options -a -e /etc/bind/named.conf ]; then
+ lameconf=$(cat /etc/bind/named.conf /etc/bind/named.conf.options | awk $script)
+else
+ if [ -e /etc/bind/named.conf ]; then
+ lameconf=$(awk $script /etc/bind/named.conf)
+ fi
+fi
+if [ "x$lameconf" != "xyes" ]; then
+ if [ ! -e /etc/bind/named.conf.options ]; then
+ touch /etc/bind/named.conf.options
+ fi
+ cp /etc/bind/named.conf.options /etc/bind/named.conf.options.$$
+ cp-update bind9-cn /etc/bind/named.conf.options.$$ <<EOF