From 701f8b1185512fb9c2358f01b8b6a48960d50f1c Mon Sep 17 00:00:00 2001 From: Leo Krueger Date: Sun, 1 Jun 2014 23:55:14 +0200 Subject: [PATCH] Ensure restart of dhcpd on config changes --- updateStatics.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/updateStatics.sh b/updateStatics.sh index d2fed04..e9675a2 100755 --- a/updateStatics.sh +++ b/updateStatics.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Simple script to update the dhcp-static files from git # CONFIGURE THIS TO YOUR GIT DIRECTORY @@ -11,4 +11,15 @@ cd $GIT_REPO su -c "git pull" $USER -cp $GIT_REPO/static.conf /etc/dhcp/static.conf +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 +fi