forked from helplessheadless/openwrt-lte-keep-alive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
66 lines (54 loc) · 2.29 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/ash
# Installation script.
DIR=/usr/wwan-keep-alive
install_netcat()
{
echo "Installing netcat (opkg install netcat) ..."
opkg -V0 update
opkg -V0 install netcat
}
finish(){
echo ""
echo "NICE ;)"
# echo "There are 2 important steps to finish this setup:"
# echo ""
# echo "1. Make sure this line is in the cron. To open the cron editor, run: crontab -e"
# echo " */2 * * * * $DIR/wwan-keep-alive.sh"
# echo ""
# echo "2. The interface representing the LTE connection is set to 'wwan0'."
# echo " To change the interface, please edit the line INTERFACE='wwan0' in the 'restart-interface.sh'."
echo ""
echo "Enjoy!"
}
download_files()
{
DIR=/usr/wwan-keep-alive
mkdir $DIR
touch $DIR/log.txt
echo "Downloading files from https://raw.githubusercontent.com/r3yr3/openwrt-wwan-keep-alive ..."
wget -q --no-check-certificate https://raw.githubusercontent.com/r3yr3/openwrt-wwan-keep-alive/master/dns-test.sh -O $DIR/dns-test.sh && chmod +x $DIR/dns-test.sh
wget -q --no-check-certificate https://raw.githubusercontent.com/r3yr3/openwrt-wwan-keep-alive/master/wwan-keep-alive.sh -O $DIR/wwan-keep-alive.sh && chmod +x $DIR/wwan-keep-alive.sh
wget -q --no-check-certificate https://raw.githubusercontent.com/r3yr3/openwrt-wwan-keep-alive/master/restart-interface.sh -O $DIR/restart-interface.sh && chmod +x $DIR/restart-interface.sh
wget -q --no-check-certificate https://raw.githubusercontent.com/r3yr3/openwrt-wwan-keep-alive/master/restart-router.sh -O $DIR/restart-router.sh && chmod +x $DIR/restart-router.sh
wget -q --no-check-certificate https://raw.githubusercontent.com/r3yr3/openwrt-wwan-keep-alive/master/wwankeepalive -O /etc/init.d/wwankeepalive && chmod +x /etc/init.d/wwankeepalive
finish
}
echo ""
echo "REYRE-STB wwankeepalive scripts."
while true; do
read -p "This will install netcat as a prerequisite. Do you want to continue (y/n)? " yn
case $yn in
[Yy]* ) install_netcat; break;;
[Nn]* ) exit;;
* ) echo "Please answer 'y' or 'n'.";;
esac
done
echo ""
while true; do
read -p "This will download the files into $DIR. Do you want to continue (y/n)? " yn
case $yn in
[Yy]* ) download_files; break;;
[Nn]* ) exit;;
* ) echo "Please answer 'y' or 'n'.";;
esac
done