From f02f770ec2849985446dc8d87b01a7c96fba0e75 Mon Sep 17 00:00:00 2001 From: Leo Krueger Date: Wed, 1 Oct 2014 22:49:13 +0200 Subject: [PATCH] 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 --- updateStatics.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/updateStatics.sh b/updateStatics.sh index c25dec7..41c4eee 100755 --- a/updateStatics.sh +++ b/updateStatics.sh @@ -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