Skip to content

Commit 0ff9a1b

Browse files
authored
Update ipv6-helper.sh
1 parent ad5a4e8 commit 0ff9a1b

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

scripts/ipv6-helper.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Welcome(){
2727
echo -e "Optional Usage:"
2828
echo -e "\tipv6-helper server: Set IPV6 configuration to server mode"
2929
echo -e "\tipv6-helper relay: Set IPV6 configuration to relay mode"
30-
echo -e "\tipv6-helper hybird: Set IPV6 configuration to hybird mode"
30+
echo -e "\tipv6-helper hybrid: Set IPV6 configuration to hybrid mode"
3131
echo -e "\tipv6-helper clean: Remove mwan3 modules\n"
3232
}
3333

@@ -44,7 +44,7 @@ RebootConfirm(){
4444

4545
CheckInstall(){
4646
if [ ! -f "/etc/opkg/ipv6-installed" ];then
47-
echo -e "${Green_font_prefix}\nYou shoud execute 'ipv6-helper install' first.\n${Green_font_prefix}"
47+
echo -e "${Red_background_prefix}\nYou shoud execute 'ipv6-helper install' first.\n${Font_color_suffix}"
4848
else
4949
echo -e "${Green_font_prefix}\nConfiguring...\n${Font_color_suffix}"
5050
fi
@@ -63,6 +63,7 @@ elif [[ $1 = "install" ]]; then
6363
# Set server to lan
6464
uci set dhcp.lan.dhcpv6=server
6565
uci set dhcp.lan.ra=server
66+
uci set dhcp.lan.ndp=hybrid
6667
uci set dhcp.lan.ra_management=1
6768
uci set dhcp.lan.ra_default=1
6869

@@ -71,6 +72,7 @@ elif [[ $1 = "install" ]]; then
7172
uci set dhcp.wan6.interface=wan
7273
uci set dhcp.wan6.ra=server
7374
uci set dhcp.wan6.dhcpv6=server
75+
uci set dhcp.wan6.ndp=hybrid
7476
uci set dhcp.wan6.master=1
7577

7678
# Disable IPV6 ula prefix
@@ -101,17 +103,17 @@ elif [[ $1 = "server" ]]; then
101103
# Set server to lan
102104
uci set dhcp.lan.dhcpv6=server
103105
uci set dhcp.lan.ra=server
106+
uci set dhcp.wan6.ndp=hybrid
104107
uci set dhcp.lan.ra_management=1
105108
uci set dhcp.lan.ra_default=1
106-
uci delete dhcp.lan.ndp
107109

108110
# Set server to wan6
109111
uci set dhcp.wan6=dhcp
110112
uci set dhcp.wan6.interface=wan
111113
uci set dhcp.wan6.ra=server
112114
uci set dhcp.wan6.dhcpv6=server
115+
uci set dhcp.wan6.ndp=hybrid
113116
uci set dhcp.wan6.master=1
114-
uci delete dhcp.wan6.ndp
115117

116118
# Commit changes
117119
uci commit
@@ -144,28 +146,28 @@ elif [[ $1 = "relay" ]]; then
144146

145147
RebootConfirm
146148

147-
elif [[ $1 = "hybird" ]]; then
149+
elif [[ $1 = "hybrid" ]]; then
148150
CheckInstall
149151

150-
# Set hybird to lan
151-
uci set dhcp.lan.dhcpv6=hybird
152-
uci set dhcp.lan.ndp=hybird
153-
uci set dhcp.lan.ra=hybird
152+
# Set hybrid to lan
153+
uci set dhcp.lan.dhcpv6=hybrid
154+
uci set dhcp.lan.ndp=hybrid
155+
uci set dhcp.lan.ra=hybrid
154156
uci set dhcp.lan.ra_management=1
155157
uci set dhcp.lan.ra_default=1
156158

157-
# Set hybird to wan6
159+
# Set hybrid to wan6
158160
uci set dhcp.wan6=dhcp
159161
uci set dhcp.wan6.interface=wan
160-
uci set dhcp.wan6.ra=hybird
161-
uci set dhcp.wan6.dhcpv6=hybird
162-
uci set dhcp.wan6.ndp=hybird
162+
uci set dhcp.wan6.ra=hybrid
163+
uci set dhcp.wan6.dhcpv6=hybrid
164+
uci set dhcp.wan6.ndp=hybrid
163165
uci set dhcp.wan6.master=1
164166

165167
# Commit changes
166168
uci commit
167169

168-
echo -e "${Green_font_prefix}Hybird mode configure successfully.\n${Font_color_suffix}"
170+
echo -e "${Green_font_prefix}Hybrid mode configure successfully.\n${Font_color_suffix}"
169171

170172
RebootConfirm
171173

0 commit comments

Comments
 (0)