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