-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdatestofrei.sh
68 lines (53 loc) · 1.8 KB
/
updatestofrei.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Simple script to update the dns (db.net.freifunk.stormarn) files from git
# CONFIGURE THIS TO YOUR GIT DIRECTORY
GIT_REPO=/home/dnsbind/bind
# CONFIGURE THIS TO THE USER TO RUN THE GIT COMMANDS AS
USER=dnsbind
cd $GIT_REPO
su -c "git pull -q" $USER
if ! cmp $GIT_REPO/db.net.freifunk.stormarn /etc/bind/db.net.freifunk.stormarn >/dev/null 2>&1 ;
then
cp $GIT_REPO/db.net.freifunk.stormarn /etc/bind/db.net.freifunk.stormarn
/usr/sbin/service bind9 status 2>&1> /dev/null
if [[ $? -eq 0 ]]
then
/usr/sbin/service bind9 restart
fi
fi
if ! cmp $GIT_REPO/db.net.freifunk.badoldesloe /etc/bind/db.net.freifunk.badoldesloe >/dev/null 2>&1 ;
then
cp $GIT_REPO/db.net.freifunk.badoldesloe /etc/bind/db.net.freifunk.badoldesloe
/usr/sbin/service bind9 status 2>&1> /dev/null
if [[ $? -eq 0 ]]
then
/usr/sbin/service bind9 restart
fi
fi
if ! cmp $GIT_REPO/db.de.freifunk-stormarn /etc/bind/db.de.freifunk-stormarn >/dev/null 2>&1 ;
then
cp $GIT_REPO/db.de.freifunk-stormarn /etc/bind/db.de.freifunk-stormarn
/usr/sbin/service bind9 status 2>&1> /dev/null
if [[ $? -eq 0 ]]
then
/usr/sbin/service bind9 restart
fi
fi
if ! cmp $GIT_REPO/db.de.freifunk-badoldesloe /etc/bind/db.de.freifunk-badoldesloe >/dev/null 2>&1 ;
then
cp $GIT_REPO/db.de.freifunk-badoldesloe /etc/bind/db.de.freifunk-badoldesloe
/usr/sbin/service bind9 status 2>&1> /dev/null
if [[ $? -eq 0 ]]
then
/usr/sbin/service bind9 restart
fi
fi
if ! cmp $GIT_REPO/db.net.freifunk.reinbek /etc/bind/db.net.freifunk.reinbek >/dev/null 2>&1 ;
then
cp $GIT_REPO/db.net.freifunk.reinbek /etc/bind/db.net.freifunk.reinbek
/usr/sbin/service bind9 status 2>&1> /dev/null
if [[ $? -eq 0 ]]
then
/usr/sbin/service bind9 restart
fi
fi