forked from mfs6174/OwrtXD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mentoinit.sh
executable file
·49 lines (48 loc) · 1018 Bytes
/
mentoinit.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
#!/bin/sh
echo "copying and setting config files..."
cp conf/network /etc/config/
mv /etc/config/dhcp /etc/config/dhcp.back
cp conf/dhcp /etc/config/
cp conf/resolv.conf /etc/
echo "copying and setting bin files..."
cp mentohust/mento /usr/sbin/
chmod +x /usr/sbin/mento
cp -r mentohust/mentohust /etc/
opkg install packages/libpcap.ipk
echo "generating config and start.sh..."
echo "[MentoHUST]
MaxFail=8
Username=$3
Password=$4
Nic=eth1.1
IP=$2
Mask=
Gateway=0.0.0.0
DNS=0.0.0.0
PingHost=0.0.0.0
Timeout=8
EchoInterval=30
RestartWait=15
StartMode=1
DhcpMode=0
DaemonMode=2
ShowNotify=5
Version=4.60
DataFile=/etc/mentohust/
DhcpScript=
">>mentohust/mentohust.conf
cp mentohust/mentohust.conf /etc/
echo "#!/bin/sh
ifconfig eth1.1 down
ifconfig eth1.1 up
ifconfig br-wan down
ifconfig br-wan up
ifconfig br-wan $2 netmask 255.255.255.0
ifconfig eth1.1 hw ether $1
ifconfig br-wan hw ether $1
mento
route add default gw $5
">>start.sh
chmod +x start.sh
cp start.sh /usr/sbin/
echo "done! just run start.sh to start"