dnsmasq/updateDnsmasq.sh

27 lines
614 B
Bash
Raw Normal View History

2014-04-10 15:21:54 +02:00
#!/bin/bash
2014-01-19 23:29:26 +01:00
# Simple script to update the dnsmasq files from git
# CONFIGURE THIS TO YOUR GIT DIRECTORY
GIT_REPO=/home/ffdnsmasq/dnsmasq
# CONFIGURE THIS TO THE USER TO RUN THE GIT COMMANDS AS
USER=ffdnsmasq
cd $GIT_REPO
su -c "git pull" $USER
2014-01-20 00:04:20 +01:00
if ! cmp $GIT_REPO/rules /etc/dnsmasq.d/rules >/dev/null 2>&1 || ! cmp $GIT_REPO/general /etc/dnsmasq.d/general >/dev/null 2>&1 ;
2014-01-19 23:29:26 +01:00
then
cp $GIT_REPO/rules /etc/dnsmasq.d/rules
cp $GIT_REPO/general /etc/dnsmasq.d/general
/usr/sbin/service dnsmasq restart
fi
2014-01-20 00:04:20 +01:00
2014-02-21 22:22:09 +01:00
ps -C "dnsmasq" 2>&1>/dev/null
if [[ $? -ne 0 ]]
2014-03-22 10:31:58 +01:00
then
2014-02-21 22:22:09 +01:00
/usr/sbin/service dnsmasq restart
fi