Only restart dhcp server if it was running before

so we do not interfere with check-gateway script that stops dhcp server if no vpn uplink is present
This commit is contained in:
Leo Krueger 2014-10-01 22:49:13 +02:00
parent 05d54834cb
commit f02f770ec2

View file

@ -15,11 +15,9 @@ if ! cmp $GIT_REPO/static.conf /etc/dhcp/static.conf >/dev/null 2>&1 ;
then
cp $GIT_REPO/static.conf /etc/dhcp/static.conf
/usr/sbin/service isc-dhcp-server restart
fi
ps -C "dhcpd" 2>&1>/dev/null
if [[ $? -ne 0 ]]
then
/usr/sbin/service isc-dhcp-server restart
/usr/sbin/service isc-dhcp-server status 2>&1> /dev/null
if [[ $? -eq 0 ]]
then
/usr/sbin/service isc-dhcp-server restart
fi
fi