-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
28 lines (22 loc) · 1.08 KB
/
install.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
#!/usr/bin/env bash
# If exist, delete old files. Do NOT delete local config files.
echo "Deleting old files"
rm /opt/najibnsupdate/bin/nsupdate
rm /opt/najibnsupdate/bin/nsupdate_func.sh
mkdir -p /opt/najibnsupdate/bin
ln -s ~/Github/najibnsupdate/README.txt /opt/najibnsupdate/README.txt
ln -s ~/Github/najibnsupdate/LICENSE.txt /opt/najibnsupdate/LICENSE.txt
ln -s ~/Github/najibnsupdate/bin/nsupdate /opt/najibnsupdate/bin/nsupdate
ln -s ~/Github/najibnsupdate/bin/nsupdate_func.sh /opt/najibnsupdate/bin/nsupdate_func.sh
# copy default configuration OR create blank dir/file
# do NOT replace/overwrite if already have at destination/installation directory
# just copy skeleton
cp -vR ~/Github/najibnsupdate/etc /opt/najibnsupdate/
# if not exist, create new empty log files
touch /opt/najibnsupdate/var/log/nsupdate.log
touch /opt/najibnsupdate/var/log/ip-list.txt
ln -s /opt/najibnsupdate/var/log/nsupdate.log /var/log/najibnsupdate.log
ln -s /opt/najibnsupdate/var/log/ip-list.txt /var/log/najibnsupdate-iplist.txt
# Add to schedule
#ln -s ~/Github/najibnsupdate/local/rc.local
echo "All done."