-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdatelauen.sh
More file actions
34 lines (26 loc) · 898 Bytes
/
updatelauen.sh
File metadata and controls
34 lines (26 loc) · 898 Bytes
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
#!/bin/bash
# Simple script to update the dns (db.net.freifunk.lauenburg) 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.lauenburg /etc/bind/db.net.freifunk.lauenburg >/dev/null 2>&1 ;
then
cp $GIT_REPO/db.net.freifunk.lauenburg /etc/bind/db.net.freifunk.lauenburg
/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-lauenburg /etc/bind/db.de.freifunk-lauenburg >/dev/null 2>&1 ;
then
cp $GIT_REPO/db.de.freifunk-lauenburg /etc/bind/db.de.freifunk-lauenburg
/usr/sbin/service bind9 status 2>&1> /dev/null
if [[ $? -eq 0 ]]
then
/usr/sbin/service bind9 restart
fi
fi