@@ -274,7 +274,7 @@ get_dslite_provider(){
274274set_interface () {
275275 current_proto=$( uci get network.${h_TUNNEL_INTERFACE} .proto 2> /dev/null)
276276 current_peeraddrdomain=$( uci get network.${h_TUNNEL_INTERFACE} .peeraddrdomain 2> /dev/null)
277- current_tunlink=$( uci get network.${h_UPLINK_INTERFACE } .tunlink 2> /dev/null)
277+ current_tunlink=$( uci get network.${h_TUNNEL_INTERFACE } .tunlink 2> /dev/null)
278278 current_mtu=$( uci get network.${h_TUNNEL_INTERFACE} .mtu 2> /dev/null)
279279 current_zone_index=$( uci show firewall | grep -E " firewall.@zone\[[0-9]+\].network=.*'$h_TUNNEL_INTERFACE '" | sed -n " s/.*@zone\[\([0-9]\+\)\].*/\1/p" )
280280 new_zone_index=$( uci show firewall | grep -E " firewall.@zone\[[0-9]+\].name='$h_TUNNEL_INTERFACE_zone '" | sed -n " s/.*@zone\[\([0-9]\+\)\].*/\1/p" )
@@ -283,8 +283,10 @@ set_interface() {
283283 if [ -z " $r_AFTR " ] || [ -z " $h_TUNNEL_INTERFACE " ] || [ -z " $h_TUNNEL_INTERFACE_MTU " ] || [ -z " $h_UPLINK_INTERFACE " ]; then
284284 echo " Failed to retrieve one or more configuration values"
285285 exit 1
286- elif [ " $current_peeraddrdomain " != " $r_AFTR_DOMAIN " ] ||
287- [ " $current_tunlink " != " $h_TUNNEL_INTERFACE " ] ||
286+ fi
287+
288+ if [ " $current_peeraddrdomain " != " $r_AFTR_DOMAIN " ] ||
289+ [ " $current_tunlink " != " $h_UPLINK_INTERFACE " ] ||
288290 [ " $current_proto " != ' dslite' ] ||
289291 [ " $current_mtu " != " $h_TUNNEL_INTERFACE_MTU " ]; then
290292 uci batch << EOF
@@ -296,10 +298,10 @@ set network.${h_TUNNEL_INTERFACE}.tunlink='${h_UPLINK_INTERFACE}'
296298set network.${h_TUNNEL_INTERFACE} .mtu='${h_TUNNEL_INTERFACE_MTU} '
297299set network.${h_TUNNEL_INTERFACE} .encaplimit='ignore'
298300EOF
299- uci delete network.${h_TUNNEL_INTERFACE} .device > /dev/null
301+ uci delete network.${h_TUNNEL_INTERFACE} .device 2> /dev/null
300302 if [ " $new_zone_index " != " $current_zone_index " ]; then
301- uci del_list firewall.@zone[$current_zone_index ].network=" $h_TUNNEL_INTERFACE "
302- uci add_list firewall.@zone[$new_zone_index ].network=" $h_TUNNEL_INTERFACE "
303+ uci del_list firewall.@zone[$current_zone_index ].network=" $h_TUNNEL_INTERFACE " 2> /dev/null
304+ uci add_list firewall.@zone[$new_zone_index ].network=" $h_TUNNEL_INTERFACE " 2> /dev/null
303305 fi
304306 uci commit
305307 ifdown ${h_TUNNEL_INTERFACE} && sleep 2 && ifup ${h_TUNNEL_INTERFACE}
314316 current_psidlen=$( uci get network.${h_TUNNEL_INTERFACE} .psidlen 2> /dev/null)
315317 current_offset=$( uci get network.${h_TUNNEL_INTERFACE} .offset 2> /dev/null)
316318 if [ " $current_peeraddr " != " $r_PEERADDR " ] ||
317- [ " $current_tunlink " != " $h_TUNNEL_INTERFACE " ] ||
319+ [ " $current_tunlink " != " $h_UPLINK_INTERFACE " ] ||
318320 [ " $current_proto " != ' map' ] ||
319321 [ " $current_mtu " != " $h_TUNNEL_INTERFACE_MTU " ] ||
320322 [ " $current_ipaddr " != " $r_IPADDR " ] ||
@@ -342,18 +344,18 @@ set network.${h_TUNNEL_INTERFACE}.mtu='${h_TUNNEL_INTERFACE_MTU}'
342344set network.${h_TUNNEL_INTERFACE} .legacymap='1'
343345set network.${h_TUNNEL_INTERFACE} .encaplimit='ignore'
344346EOF
345- uci delete network.${h_TUNNEL_INTERFACE} .device > /dev/null
347+ uci delete network.${h_TUNNEL_INTERFACE} .device 2> /dev/null
346348 if [ " $new_zone_index " != " $current_zone_index " ]; then
347- uci del_list firewall.@zone[$current_zone_index ].network=" $h_TUNNEL_INTERFACE "
348- uci add_list firewall.@zone[$new_zone_index ].network=" $h_TUNNEL_INTERFACE "
349+ uci del_list firewall.@zone[$current_zone_index ].network=" $h_TUNNEL_INTERFACE " 2> /dev/null
350+ uci add_list firewall.@zone[$new_zone_index ].network=" $h_TUNNEL_INTERFACE " 2> /dev/null
349351 fi
350352 uci commit
351353 ifdown ${h_TUNNEL_INTERFACE} && sleep 2 && ifup ${h_TUNNEL_INTERFACE}
352354 logger -t fleth " New map-e configuratin committed ${h_TUNNEL_INTERFACE} =${r_PEERADDR} "
353355 fi
354356 elif [ " $new_zone_index " != " $current_zone_index " ]; then
355- uci del_list firewall.@zone[$current_zone_index ].network=" $h_TUNNEL_INTERFACE "
356- uci add_list firewall.@zone[$new_zone_index ].network=" $h_TUNNEL_INTERFACE "
357+ uci del_list firewall.@zone[$current_zone_index ].network=" $h_TUNNEL_INTERFACE " 2> /dev/null
358+ uci add_list firewall.@zone[$new_zone_index ].network=" $h_TUNNEL_INTERFACE " 2> /dev/null
357359 uci commit firewall
358360 fi
359361 if check_interface_proto_invalid ${h_TUNNEL_INTERFACE} ; then
@@ -522,6 +524,7 @@ elif [ "$1" = "replace_mapsh" ]; then
522524
523525 # Replace the file
524526 mv /tmp/map.sh.new " $MAPSH_PATH "
527+ chmod +x " $MAPSH_PATH "
525528 if [ $? -ne 0 ]; then
526529 echo " ERROR: Failed to replace file"
527530 exit 1
0 commit comments