-
Notifications
You must be signed in to change notification settings - Fork 3
/
install-rtr.sh
executable file
·54 lines (44 loc) · 1.05 KB
/
install-rtr.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
#!/bin/bash
TRG=/rtr
TMP=/root/install.rtr
mkdir -p $TMP
cd $TMP/
rm rtr.zip
wget www.freertr.org/rtr.zip
rm -rf rtr
unzip -o rtr.zip > /dev/null
rm $TMP/misc/default.cfg
wget -O $TMP/misc/default.cfg www.freertr.org/install-sw.txt
cd $TMP/src/
./d.sh
rm rtr.ver
wget www.freertr.org/rtr.ver
rm rtr.jar
wget www.freertr.org/rtr.jar
cd $TMP/binImg/
rm rtr-`uname -m`.tar
wget www.freertr.org/rtr-`uname -m`.tgz
cd $TMP/binTmp/
tar xvf ../binImg/rtr-`uname -m`.tgz
mkdir -p $TRG
cat > $TRG/update.sh << EOF
#!/bin/sh
sudo apt update
sudo apt dist-upgrade
sudo apt remove apparmor
sudo apt autoremove
sudo apt clean
sudo sync
sudo fstrim -v -a -m 1M
#sudo e4defrag /
EOF
chmod +x $TRG/update.sh
echo Configuring freeRtr to $TRG directory
echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf
echo net.ipv6.conf.default.disable_ipv6=1 >> /etc/sysctl.d/disableipv6.conf
echo kernel.panic=10 > /etc/sysctl.d/panic.conf
cp $TMP/src/rtr.jar $TRG/
cp $TMP/src/rtr.ver $TRG/
cp $TMP/binTmp/*.bin $TRG/
sync
echo freeRtr installation file in $TRG finished!