-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenvpn.sh
62 lines (38 loc) · 991 Bytes
/
openvpn.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/sh
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
CYAN='\033[0;36m'
GRAY='\033[0;37m'
NC='\033[0m' # No Color
echo "Running as root..."
sleep 2
clear
opkg update
opkg install openvpn-openssl
sleep 2
opkg install luci-app-openvpn
uci set network.OVPNER=interface
uci set network.OVPNER.proto='none'
uci set network.OVPNER.device='tun0'
uci commit
RESULT=`grep -o OVPNER /etc/config/firewall`
if [ "$RESULT" == "OVPNER" ]; then
echo -e "${GREEN}Cool !${NC}"
else
echo -e "${YELLOW}Replacing${YELLOW}"
echo "config zone
option name 'SIXOS'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'OVPNER'
config forwarding
option src 'lan'
option dest 'SIXOS'" >> /etc/config/firewall
fi
echo -e "${GREEN} Made With Love By : 4Arouter ${NC}"