summaryrefslogtreecommitdiffstats
path: root/roles/dns/files/update-dns
blob: 1719057af9678b33a57ba51670d56d39f76ae3c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
dnsgit='https://infrastructure.fedoraproject.org/infra/dns.git'
destdir='/var/named/master/'

if [ ! -d $destdir ];
then
  git clone $dnsgit $destdir
fi

cd $destdir
git fetch origin

if [ "`git diff origin/master`" != "" ];
then
  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