shutdown.sh is executed after network is down

  • Oh, yeah, sorry I forgot^^'
    and I'm using 7.0.1 if that's needed^^

    Code
    1. if /usr/bin/systemctl list-jobs | /bin/egrep -q 'reboot.target.*start' > /dev/null; then
    2.   # reboot
    3.  #  wget -q 'http://192.168.1.203/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF';
    4. else
    5.   # shutdown
    6. wget -q 'http://192.168.1.42/cgi-bin/system_mgr.cgi?cmd=cgi_shutdown' ;
    7. wget -q 'http://192.168.1.203/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF';
    8. fi

    Edited once, last by qwasy ().

  • You have no commands after if (only comments). You need to use character : on one line in this case like

    Code
    1. if /usr/bin/systemctl list-jobs | /bin/egrep -q 'reboot.target.*start' > /dev/null; then
    2.   : # must use this line
    3.   # reboot
    4.   #  wget -q 'http://192.168.1.203/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF';
    5. else
    6.   # shutdown
    7.   wget -q 'http://192.168.1.42/cgi-bin/system_mgr.cgi?cmd=cgi_shutdown' ;
    8.   wget -q 'http://192.168.1.203/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF';
    9. fi

    Support my work with small (or big) Paypal donation


    Amlogic devices works better with CoreELEC

    Blu-ray Disc Java menus support - forum thread, Github

    my lamp addon (unofficial/community with limited support)
    my touchscreen support and instructions by Grruhn (now touchscreen addon exists in repository)

    Edited once, last by vpeter ().