ramips: replace backticks by $(...)
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 20 Sep 2019 12:07:56 +0000 (14:07 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 21 Sep 2019 20:17:39 +0000 (22:17 +0200)
This replaces deprecated backticks by more versatile $(...) syntax.

While at it, remove some useless cat commands and deprecated
egrep commands.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips

index 7ecc11b37b53bf54a0d5e706db55217ce1e57cdf..63644331e5d0005664bb8db430ef31469354d483 100755 (executable)
@@ -14,10 +14,10 @@ ramips_setup_rt3x5x_vlans()
        local wanports=""
        local lanports=""
        for port in 5 4 3 2 1 0; do
-               if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
+               if [ "$(swconfig dev rt305x port $port get disable)" = "1" ]; then
                        continue
                fi
-               if [ `swconfig dev rt305x port $port get lan` = "0" ]; then
+               if [ "$(swconfig dev rt305x port $port get lan)" = "0" ]; then
                        wanports="$port:wan $wanports"
                else
                        lanports="$port:lan $lanports"
@@ -503,7 +503,7 @@ ramips_setup_interfaces()
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0"
                ;;
        *)
-               RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
+               RT3X5X=$(grep -E "(RT3.5|RT5350)" /proc/cpuinfo)
                if [ -n "${RT3X5X}" ]; then
                        ramips_setup_rt3x5x_vlans
                else
index a395956d04f3164b8ee6df27e390d4150c7551b9..003a4dda7b60ef31abd27a4932913a24c03bafb1 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 ramips_set_preinit_iface() {
-       RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350|MT7628|MT7688|MT7620|MT7621)"`
+       RT3X5X=$(grep -E "(RT3.5|RT5350|MT7628|MT7688|MT7620|MT7621)" /proc/cpuinfo)
 
        if [ -n "${RT3X5X}" ]; then
                # The ethernet switch driver enables VLAN by default, but