[+] Check scripts with shellcheck and semgrep

This module tries to identify shell scripts and analyses them with shellcheck - https://www.shellcheck.net/.



==> Check scripts with shellcheck

[+] Found 5 issues in script (common linux file: no): /etc/events/DHCPS-REDETECT.php (-rwxr-xr-x root root)


[+] Found 1 issues in script (common linux file: no): /etc/events/DHCPS-REDETECT.sh (-rwxr-xr-x root root)


[+] Found 6 issues in script (common linux file: no): /etc/events/AUTOCONFIG.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/events/INF-RESTART.php (-rwxr-xr-x root root)


[+] Found 1 issues in script (common linux file: no): /etc/events/SEALPAC-CLEAR.sh (-rwxr-xr-x root root)


[+] Found 1 issues in script (common linux file: no): /etc/events/SEALPAC-SAVE.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/events/SEALPAC-LOAD.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/events/UPDATELEASES.sh (-rwxr-xr-x root root)


[+] Found 5 issues in script (common linux file: no): /etc/events/UPDATELEASES.php (-rwxr-xr-x root root)


[+] Found 5 issues in script (common linux file: no): /etc/events/WAN-DETECT.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/events/WAN-1_dhcp_cb.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/events/WANV6_AUTOCONF_DETECT.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/events/WANV6_ppp_dis.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/events/WANV6-DETECT.sh (-rwxr-xr-x root root)


[+] Found 5 issues in script (common linux file: no): /etc/events/WANV6_ppp_chk.sh (-rwxr-xr-x root root)


[+] Found 5 issues in script (common linux file: no): /etc/events/WAN_dhcp_chk.sh (-rwxr-xr-x root root)


[+] Found 5 issues in script (common linux file: no): /etc/events/WAN_dhcp_pri.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/events/WAN_ppp_dis.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/events/dhcp_pri_chk.sh (-rwxr-xr-x root root)


[+] Found 1 issues in script (common linux file: no): /etc/events/freset.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/events/checkfw.sh (-rwxr-xr-x root root)


[+] Found 1 issues in script (common linux file: no): /etc/events/reboot.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init.d/S19init.sh (-rwxr-xr-x root root)


[+] Found 5 issues in script (common linux file: no): /etc/init0.d/S21wlan.sh (-rwxr-xr-x root root)


[+] Found 5 issues in script (common linux file: no): /etc/init0.d/S21layout.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init0.d/S40event.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init0.d/S41autowan.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init0.d/S41autowanv6.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init0.d/S42pthrough.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init0.d/S40gpioevent.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init0.d/S41inf.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init0.d/S65ddnsd.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/init0.d/S80telnetd.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/scripts/IP-WAIT.php (-rwxr-xr-x root root)


[+] Found 6 issues in script (common linux file: no): /etc/scripts/IPV4.DSLITE.php (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/scripts/RA-WAIT.php (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/scripts/IPV6.CHILD.php (-rwxr-xr-x root root)


[+] Found 6 issues in script (common linux file: no): /etc/scripts/IPV4.INET.php (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/scripts/IPV6.INET.php (-rwxr-xr-x root root)


[+] Found 7 issues in script (common linux file: no): /etc/scripts/V6IN4-TUNNEL.php (-rwxr-xr-x root root)


[+] Found 3 issues in script (common linux file: no): /etc/scripts/conntrack_flush.sh (-rwxr-xr-x root root)


[+] Found 3 issues in script (common linux file: no): /etc/scripts/dbload.sh (-rwxr-xr-x root root)


[+] Found 6 issues in script (common linux file: no): /etc/scripts/ddnsd_helper.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/scripts/dhcp6s_helper.php (-rwxr-xr-x root root)


[+] Found 11 issues in script (common linux file: no): /etc/scripts/delpathbytarget.sh (-rwxr-xr-x root root)


[+] Found 1 issues in script (common linux file: no): /etc/scripts/dlcfg_hlper.sh (-rwxr-xr-x root root)


[+] Found 3 issues in script (common linux file: no): /etc/scripts/dns-helper.sh (-rwxr-xr-x root root)


[+] Found 8 issues in script (common linux file: no): /etc/scripts/getmodem.sh (-rwxr-xr-x root root)


[+] Found 11 issues in script (common linux file: no): /etc/scripts/igmpproxy_helper.sh (-rwxr-xr-x root root)


[+] Found 15 issues in script (common linux file: yes): /etc/scripts/ip-down (-rwxr-xr-x root root)


[+] Found 15 issues in script (common linux file: yes): /etc/scripts/ip-up (-rwxr-xr-x root root)


[+] Found 15 issues in script (common linux file: yes): /etc/scripts/ipv6-down (-rwxr-xr-x root root)


[+] Found 15 issues in script (common linux file: yes): /etc/scripts/ipv6-up (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/scripts/killpid.sh (-rwxr-xr-x root root)


[+] Found 7 issues in script (common linux file: no): /etc/scripts/libs/dns-helper.php (-rw-r--r-- root root)


[+] Found 5 issues in script (common linux file: no): /etc/scripts/libs/igmpproxy_helper.php (-rw-r--r-- root root)


[+] Found 11 issues in script (common linux file: no): /etc/scripts/mldproxy_helper.sh (-rwxr-xr-x root root)


[+] Found 1 issues in script (common linux file: no): /etc/scripts/ping.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/scripts/ppp-status (-rwxr-xr-x root root)


[+] Found 3 issues in script (common linux file: no): /etc/scripts/resetstats.sh (-rwxr-xr-x root root)


[+] Found 7 issues in script (common linux file: no): /etc/scripts/setdate.sh (-rwxr-xr-x root root)


[+] Found 9 issues in script (common linux file: no): /etc/scripts/stopchild.php (-rwxr-xr-x root root)


[+] Found 4 issues in script (common linux file: no): /etc/scripts/settime.sh (-rwxr-xr-x root root)


[+] Found 3 issues in script (common linux file: no): /etc/scripts/ubcom-monitor.sh (-rwxr-xr-x root root)


[+] Found 3 issues in script (common linux file: no): /etc/scripts/ubcom-run.sh (-rwxr-xr-x root root)


[+] Found 8 issues in script (common linux file: no): /etc/scripts/upnp/M-SEARCH.php (-rw-r--r-- root root)


[+] Found 8 issues in script (common linux file: no): /etc/scripts/upnp/M-SEARCH.sh (-rwxr-xr-x root root)


[+] Found 4 issues in script (common linux file: no): /etc/scripts/upnp/NOTIFYAB.php (-rw-r--r-- root root)


[+] Found 6 issues in script (common linux file: no): /etc/scripts/upnp/run.NOTIFY-PROPCHANGE.php (-rw-r--r-- root root)


[+] Found 6 issues in script (common linux file: no): /etc/scripts/upnp/run.NOTIFY-WFADEV.php (-rw-r--r-- root root)


[+] Found 12 issues in script (common linux file: no): /etc/scripts/upnp/NOTIFYAB.sh (-rwxr-xr-x root root)


[+] Found 6 issues in script (common linux file: no): /etc/scripts/upwifistatshlper.sh (-rwxr-xr-x root root)


[+] Found 2 issues in script (common linux file: no): /etc/scripts/wps.sh (-rwxr-xr-x root root)


[+] Found 7 issues in script (common linux file: no): /etc/services/INET/inet4_dhcpc_helper.php (-rw-r--r-- root root)


[+] Found 10 issues in script (common linux file: no): /etc/services/INET/inet6_dhcpc_helper.php (-rw-r--r-- root root)


[+] Found 10 issues in script (common linux file: no): /etc/services/INET/inet6_rdisc6_helper.php (-rwxr-xr-x root root)


[+] Found 7 issues in script (common linux file: no): /etc/services/INET/ppp4_ipdown.php (-rw-r--r-- root root)


[+] Found 7 issues in script (common linux file: no): /etc/services/INET/ppp4_ipup.php (-rw-r--r-- root root)


[+] Found 7 issues in script (common linux file: no): /etc/services/INET/ppp6_ipdown.php (-rwxr-xr-x root root)


[+] Found 8 issues in script (common linux file: no): /etc/services/INET/ppp4_status.php (-rw-r--r-- root root)


[+] Found 7 issues in script (common linux file: no): /etc/services/INET/ppp6_ipup.php (-rwxr-xr-x root root)


[+] Found 11 issues in script (common linux file: no): /etc/services/svchlper (-rwxr-xr-x root root)


[+] Found 1 issues in script (common linux file: no): /usr/sbin/phpsh (-rwxr-xr-x root root)


[+] Found 17 issues in script (common linux file: no): /usr/sbin/mfc (-rwxr-xr-x root root)





==> Summary of shell issues (shellcheck)

[+] Found 509 issues in 114 shell scripts (shellcheck mode)



    [+] SC1036 (error): '(' is invalid here. Did you forget to escape it?
    [+] SC1050 (error): Expected 'then'.
    [+] SC1054 (error): You need a space after the '{'.
    [+] SC1056 (error): Expected a '}'. If you have one, try a ; or in front of it.
    [+] SC1064 (error): Expected a { to open the function definition.
    [+] SC1065 (error): Trying to declare parameters? Don't. Use () and refer to params as $1, $2..
    [+] SC1072 (error): Missing '}'. Fix any mentioned problems and try again.
    [+] SC1073 (error): Couldn't parse this brace group. Fix to allow more checks.
    [+] SC1088 (error): Parsing stopped here. Invalid use of parentheses?
    [+] SC1127 (error): Was this intended as a comment? Use # in sh.
    [+] SC2283 (error): Remove spaces around = to assign (or use [ ] to compare, or quote '=' if literal).
    [+] SC1009 (info): The mentioned syntax error was in this function.
    [+] SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
    [+] SC2035 (info): Use ./*glob* or -- *glob* so names with dashes won't become options.
    [+] SC2086 (info): Double quote to prevent globbing and word splitting.
    [+] SC2050 (warning): This expression is constant. Did you forget the $ on a variable?
    [+] SC2092 (warning): Remove backticks to avoid executing output (or use eval if intentional).
    [+] SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
    [+] SC2188 (warning): This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
    [+] SC2211 (warning): This is a glob used as a command name. Was it supposed to be in ${..}, array, or is it missing quoting?
    [+] SC3014 (warning): In POSIX sh, == in place of = is undefined.
    [+] SC3031 (warning): In POSIX sh, redirecting to/from globs is undefined.
    [+] SC3037 (warning): In POSIX sh, echo flags are undefined.


==> Check shell scripts with semgrep

[+] Found 209 issues in 103 shell scripts





==> Summary of shell eval usages

[-] No eval usage found in shell scripts