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

    Edited once, last by qwasy (June 18, 2016 at 8:45 AM).

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

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

    Edited once, last by vpeter (June 18, 2016 at 10:03 AM).