forked from rafale77/Nuke-Vera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Nukevera.sh
56 lines (56 loc) · 2.05 KB
/
Nukevera.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
#!/bin/sh
echo "This is an script will disable all mios programs on your vera plus/secure and make it a zwave and zigbee device over IP"
echo "You will require socat on the host controller to capture the signal and create a virtual serial port out of it"
while true; do
read -p "Are you ready? " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes, no or press Ctrl + c to exit";;
esac
done
echo "Installing and configuring ser2net"
opkg update
opkg install ser2net
echo '3333:raw:0:/dev/ttyS0:115200 8DATABITS NONE 1STOPBIT' >> /etc/ser2net.conf
echo "zwave configured on port 3333"
echo '3300:raw:0:/dev/ttyS2:57600 8DATABITS NONE 1STOPBIT' >> /etc/ser2net.conf
echo "zigbee configured on port 3300"
echo "Backing up Vera files"
mkdir /root/backup
cp /etc/init.d/lighttpd /root/backup/
cp /etc/init.d/ntpclient /root/backup/
cp /usr/bin/Start_NetworkMonitor.sh /root/backup/
cp /usr/bin/Start_LuaUPnP.sh /root/backup/
cp /usr/bin/cmh-ra-daemon.sh /root/backup/
cp /usr/bin/relay-daemon.sh /root/backup/
cp /usr/bin/tech-ra-daemon.sh /root/backup/
cp /usr/bin/Start_serproxy.sh /root/backup/
echo "Disabling vera programs"
sed -i '9s/.*/#&/' /etc/init.d/lighttpd
sed -i '10s/.*/#&/' /etc/init.d/lighttpd
sed -i '11s/.*/#&/' /etc/init.d/lighttpd
sed -i '3 a exit 0' /etc/init.d/ntpclient
sed -i '2 a wifi down' /usr/bin/Start_NetworkMonitor.sh
sed -i '3 a ser2net' /usr/bin/Start_NetworkMonitor.sh
sed -i '4 a exit 0' /usr/bin/Start_NetworkMonitor.sh
sed -i '2 a exit 0' /usr/bin/Start_LuaUPnP.sh
sed -i '2 a exit 0' /usr/bin/cmh-ra-daemon.sh
sed -i '2 a exit 0' /usr/bin/relay-daemon.sh
sed -i '2 a exit 0' /usr/bin/tech-ra-daemon.sh
sed -i '2 a exit 0' /usr/bin/Start_serproxy.sh
opkg remove odhcpd
echo "vera disabled, now checking serial ports"
ser2net
netstat -antp
echo
while true; do
read -p "check ports 3333 and 3000 are listening. Are they there? Y/N" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes, no or press Ctrl + c to exit";;
esac
done
echo "rebooting"
reboot