Make update-dns only reload named if something actually changed

This commit is contained in:
Patrick Uiterwijk 2014-12-16 21:08:26 +00:00
parent 80e72f481b
commit 3886210b35

View file

@ -2,18 +2,21 @@
dnsgit='https://infrastructure.fedoraproject.org/infra/dns.git' dnsgit='https://infrastructure.fedoraproject.org/infra/dns.git'
destdir='/var/named/master/' destdir='/var/named/master/'
if [ -d $destdir ]; if [ ! -d $destdir ];
then then
cd $destdir
git pull -X theirs
else
git clone $dnsgit $destdir git clone $dnsgit $destdir
fi fi
cd $tmpdir
cd $destdir
git fetch origin
if [ "`git diff origin/master master`" != "" ];
then
git pull -X theirs
# change context so the chroot can cope # change context so the chroot can cope
chown -R named.named $destdir chown -R named.named $destdir
chcon -u system_u $destdir/* $destdir/*/* chcon -u system_u $destdir/* $destdir/*/*
# reload named # reload named
/sbin/service named start >>/dev/null 2>&1 /sbin/service named start >>/dev/null 2>&1
/sbin/service named reload >>/dev/null 2>&1 /sbin/service named reload >>/dev/null 2>&1
fi