forked from ondrej1024/ddguard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·36 lines (28 loc) · 725 Bytes
/
install.sh
File metadata and controls
executable file
·36 lines (28 loc) · 725 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
35
36
#! /bin/bash
BINDIR="/usr/local/bin"
if [ $UID -ne 0 ]; then
echo "Please run as root"
exit
fi
echo "Installing program files"
cp ddguard.py $BINDIR
cp helpers.py $BINDIR
cp sensor_codes.py $BINDIR
cp cnl24driverlib.py $BINDIR
cp nightscoutlib.py $BINDIR
echo "Installing udev scripts"
cp script/30-contour.rules /etc/udev/rules.d/
cp script/contour-hotplug.sh $BINDIR
echo "Installing configuration file"
cp conf/ddguard.conf /etc/
echo "Enable and start daemon"
cp init.d/ddguard /etc/init.d/
systemctl enable ddguard.service
systemctl start ddguard.service
sleep 2
if [ $(systemctl is-active ddguard.service) == "active" ]; then
echo "Install successful"
else
echo "ERROR: Install failed"
fi
exit 0