Skip to content
Snippets Groups Projects
Commit 7bba4e48 authored by Sukru Senli's avatar Sukru Senli
Browse files

iopsys-econet: fix tc3162-eth-portmap.sh

parent b0c81469
Branches
No related tags found
No related merge requests found
...@@ -25,22 +25,19 @@ tc3162_eth_portmap() { ...@@ -25,22 +25,19 @@ tc3162_eth_portmap() {
;; ;;
br-lan) br-lan)
section="$(uci show network | grep 'name=.*br-lan' | cut -d'.' -f2)" section="$(uci show network | grep 'name=.*br-lan' | cut -d'.' -f2)"
lan_ports="$(uci -q get network.$section.ports)" lan_ports="$(uci -q get network.$section.ports | tr -d 'eth0.')"
lan1_port=$(echo $lan_ports | cut -d' ' -f1 | cut -d'.' -f2) port_num=$(echo $lan_ports | wc -w)
lan1_port="${lan1_port:--1}" [ $port_num -gt 0 ] && lan1_port="$(echo $lan_ports | cut -d' ' -f1)"
lan2_port=$(echo $lan_ports | cut -d' ' -f2 | cut -d'.' -f2) [ $port_num -gt 1 ] && lan2_port="$(echo $lan_ports | cut -d' ' -f2)"
lan2_port="${lan2_port:--1}" [ $port_num -gt 2 ] && lan3_port="$(echo $lan_ports | cut -d' ' -f3)"
lan3_port=$(echo $lan_ports | cut -d' ' -f3 | cut -d'.' -f2) [ $port_num -gt 3 ] && lan4_port="$(echo $lan_ports | cut -d' ' -f4)"
lan3_port="${lan3_port:--1}" [ $port_num -gt 4 ] && lan5_port="$(echo $lan_ports | cut -d' ' -f5)"
lan4_port=$(echo $lan_ports | cut -d' ' -f4 | cut -d'.' -f2) [ $port_num -gt 5 ] && lan6_port="$(echo $lan_ports | cut -d' ' -f6)"
lan4_port="${lan4_port:--1}"
lan5_port=$(echo $lan_ports | cut -d' ' -f5 | cut -d'.' -f2)
lan5_port="${lan5_port:--1}"
lan6_port=$(echo $lan_ports | cut -d' ' -f6 | cut -d'.' -f2)
lan6_port="${lan6_port:--1}"
;; ;;
esac esac
logger -t "netifd-pre-reload" "echo $wan_port $lan1_port $lan2_port $lan3_port $lan4_port $lan5_port $lan6_port > /proc/tc3162/eth_portmap"
echo $wan_port $lan1_port $lan2_port $lan3_port $lan4_port $lan5_port $lan6_port > /proc/tc3162/eth_portmap echo $wan_port $lan1_port $lan2_port $lan3_port $lan4_port $lan5_port $lan6_port > /proc/tc3162/eth_portmap
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment