-
Notifications
You must be signed in to change notification settings - Fork 6
/
mentoinit.back
49 lines (48 loc) · 1.06 KB
/
mentoinit.back
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/
mv /usr/share/udhcpc/default.script /usr/share/udhcpc/default.script.back
cp conf/default.script /usr/share/udhcpc/
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=1
DaemonMode=2
ShowNotify=5
Version=4.60
DataFile=/etc/mentohust/
DhcpScript=udhcpc -r $2 -i br-wan
">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 0.0.0.0
ifconfig eth1.1 hw ether $1
ifconfig br-wan hw ether $1
mento
">start.sh
chmod +x start.sh
cp start.sh /usr/sbin/
echo "done! just run start.sh to start"