handle named -c option properly; allow -D option to be used with
bind-chroot
This commit is contained in:
parent
e54aef0196
commit
38a73ea995
30
named.init
30
named.init
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
[ -r /etc/sysconfig/named ] && . /etc/sysconfig/named
|
[ -r /etc/sysconfig/named ] && . /etc/sysconfig/named
|
||||||
|
|
||||||
|
[ -n "$ROOTDIR" ] && ROOTDIR=`echo $ROOTDIR | sed 's#//*#/#g;s#/$##'`
|
||||||
|
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
named='named'
|
named='named'
|
||||||
if [[ "$ENABLE_SDB" = [yY1]* ]] && [ -x /usr/sbin/named_sdb ]; then
|
if [[ "$ENABLE_SDB" = [yY1]* ]] && [ -x /usr/sbin/named_sdb ]; then
|
||||||
@ -28,20 +30,20 @@ prog=$named
|
|||||||
|
|
||||||
[ -x /usr/sbin/$named ] || exit 1
|
[ -x /usr/sbin/$named ] || exit 1
|
||||||
|
|
||||||
named_conf=/etc/named.conf
|
nmdcOption()
|
||||||
c_opt=0
|
{ let i=0;
|
||||||
if echo "$OPTIONS" | egrep -q '(\<|['"'"'"\ \ ])-c'; then
|
for a in $*;
|
||||||
named_conf=`echo ${OPTIONS} | sed 's/^.*[\ \ ]-c[\ \ ]*//;s/[\ \ '"'"'"].*$//'`;
|
do ((++i));
|
||||||
c_opt=1;
|
if [ $a = -c ]; then
|
||||||
fi;
|
((++i));
|
||||||
|
eval 'echo $'$i;
|
||||||
[ -r ${ROOTDIR}/${named_conf} ] || exit 1
|
elif [[ $a = -c* ]]; then
|
||||||
|
echo ${a#-c};
|
||||||
if [ ${c_opt} -eq 0 ]; then
|
fi;
|
||||||
named_conf='';
|
done;
|
||||||
fi;
|
}
|
||||||
|
named_conf=`nmdcOption $OPTIONS`;
|
||||||
[ -n "$ROOTDIR" ] && ROOTDIR=`echo $ROOTDIR | sed 's#//*#/#g;s#/$##'`
|
[ -r ${ROOTDIR}/${named_conf:-etc/named.conf} ] || exit 1
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
# Start daemons.
|
# Start daemons.
|
||||||
|
Loading…
Reference in New Issue
Block a user