Make update-dns only reload named if something actually changed
This commit is contained in:
parent
80e72f481b
commit
3886210b35
1 changed files with 14 additions and 11 deletions
|
@ -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
|
|
||||||
|
|
||||||
# change context so the chroot can cope
|
cd $destdir
|
||||||
chown -R named.named $destdir
|
git fetch origin
|
||||||
chcon -u system_u $destdir/* $destdir/*/*
|
|
||||||
# reload named
|
if [ "`git diff origin/master master`" != "" ];
|
||||||
/sbin/service named start >>/dev/null 2>&1
|
then
|
||||||
/sbin/service named reload >>/dev/null 2>&1
|
git pull -X theirs
|
||||||
|
# change context so the chroot can cope
|
||||||
|
chown -R named.named $destdir
|
||||||
|
chcon -u system_u $destdir/* $destdir/*/*
|
||||||
|
# reload named
|
||||||
|
/sbin/service named start >>/dev/null 2>&1
|
||||||
|
/sbin/service named reload >>/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue