-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·42 lines (32 loc) · 1.26 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo -e "This script must be run as root" 1>&2
exit 1
fi
echo -e '\nInstalling the required programs...'
sudo apt-get --assume-yes install socat git
cd /tmp
echo -e '\nCloning the github repository...'
git clone https://github.com/bodiroga/zwave-socat-gateway.git
cd zwave-socat-gateway
echo -e '\nMoving the udev rule to the corresponding folder...'
cp -rf udev/* /etc/udev/rules.d/
echo -e '\nMoving the program files to the /root directory...'
cp -rf files/* /root
echo -e '\nAdding the start script file...'
cp -rf init.d/* /etc/init.d/
chmod +x /etc/init.d/zwave-socat
update-rc.d zwave-socat defaults
cd /root
if [ ! -f CONFIGURATION ]; then
echo -e '\nCreating the CONFIGURATION file, edit the parameters to meet your needs...'
cp CONFIGURATION_DEFAULT CONFIGURATION
else
echo -e '\nYour CONFIGURATION file already exists, we will not touch it...'
fi
echo -e '\nRemoving the tmp folder...'
rm -rf /tmp/zwave-socat-gateway
echo -e '\n----------------------------------------------------------------------------'
echo -e 'Go to the /root folder, read the README file and edit the CONFIGURATION file'
echo -e '----------------------------------------------------------------------------'