History with i-Stor iS607

    The other day (after a power outage and a full discharge of the UPS battery),
    there was a need, in addition to automatically turning off the router when the UPS is low
    , also turning off the saber storage.

    It was decided to do this at the time of disconnecting the router itself
    by adding the necessary set of commands to rc.shutdown.

    After picking cgi-script treasured team was obtained:
    curl -d "powerAction=2" <storage_ip>:80/cgi/power/powerHandler.cgi

    In addition, if to be authorized:
    curl -d "username=admin&password=_passwd_here_" <storage_ip>:80/loginHandler.cgi,
    we obtain the following parameters:
    <input type = "hidden" name = "username" value = "admin">
    <input type = "hidden" name = "sessionId" value = "q1pOmWykGFZUnSAjWG9189d1jnZGXBQcr5QDPcLmHB4Uhu21YZTUZWK68zCTYgV">


    The most amazing thing about this is that powerHandler does not even try
    to steal data from cookies when turning off / rebooting NAS storage,
    despite the presence of the same LoginUser.

    Everything described above is typical for firmware 2.6.3-20080530.

    And finally, what is added in /etc/rc.shutdown:
    if [ `ping -qc 3 <storage_ip> | awk '/packets/ { if ( $4 > 0 ) { print 1; } else { print 0; } }'` -eq 1 ]; then
    echo "Send shutdown signal to storage"
    curl -d "powerAction=2" <storage_ip>:80/cgi/power/powerHandler.cgi >/dev/null 2>&1
    fi

    Also popular now: