2014-06-01 23:55:14 +02:00
|
|
|
#!/bin/bash
|
2013-03-24 16:12:19 +01:00
|
|
|
# Simple script to update the dhcp-static files from git
|
2013-03-24 15:43:04 +01:00
|
|
|
|
2013-03-24 16:12:19 +01:00
|
|
|
# CONFIGURE THIS TO YOUR GIT DIRECTORY
|
2013-03-24 16:24:05 +01:00
|
|
|
GIT_REPO=/home/dhcpstatic/dhcp-static
|
2013-03-24 16:12:19 +01:00
|
|
|
|
|
|
|
# CONFIGURE THIS TO THE USER TO RUN THE GIT COMMANDS AS
|
2013-03-24 16:24:05 +01:00
|
|
|
USER=dhcpstatic
|
2013-03-24 16:12:19 +01:00
|
|
|
|
|
|
|
cd $GIT_REPO
|
|
|
|
|
2014-07-20 13:41:47 +02:00
|
|
|
su -c "git pull -q" $USER
|
2013-03-24 16:12:19 +01:00
|
|
|
|
2014-06-01 23:55:14 +02:00
|
|
|
if ! cmp $GIT_REPO/static.conf /etc/dhcp/static.conf >/dev/null 2>&1 ;
|
|
|
|
then
|
|
|
|
cp $GIT_REPO/static.conf /etc/dhcp/static.conf
|
|
|
|
|
2014-10-01 22:49:13 +02:00
|
|
|
/usr/sbin/service isc-dhcp-server status 2>&1> /dev/null
|
|
|
|
if [[ $? -eq 0 ]]
|
|
|
|
then
|
|
|
|
/usr/sbin/service isc-dhcp-server restart
|
|
|
|
fi
|
2014-06-01 23:55:14 +02:00
|
|
|
fi
|