Hirdetés

Új hozzászólás Aktív témák

  • vargalex

    félisten

    válasz Treck #33190 üzenetére

    Szia!

    OK. Megvan a hiba. A HGW-n futó web server tárolja, hogy sikerült-e már bejelentkezni, így valószínűleg, amikor próbáltam, egy bejelentkezett állapot volt rajta. Így már mennie kellene:

    #!/bin/sh
    RESULT=$(wget -O - http://192.168.100.1/status/connection-downstream.asp 2>/dev/null)
    ISLOGIN=$(echo "$RESULT" | grep loginUsername | wc -l)
    if [ $ISLOGIN -eq 1 ]; then
    CSRFVALUE=$(echo "$RESULT" | grep "CSRFValue\"" | cut -f 4 -d "=" | cut -f 1 -d ">")
    LOGINFORM=$(echo "$RESULT" | grep form | grep "name=\"login\"" | cut -f 2 -d "\"")
    RESULT=$(wget -O - --post-data="CSRFValue=$CSRFVALUE&loginUsername=admin&loginPassword=admin&logoffUser=0" http://192.168.100.1$LOGINFORM 2>/dev/null)
    fi
    DOWNSTREAM=$(wget -O - http://192.168.100.1/status/connection-downstream.asp 2>/dev/null | grep "TAG_UPC_T38" | cut -f 23 -d ">" | cut -f 1 -d "<")
    UPSTREAM=$(wget -O - http://192.168.100.1/status/connection-upstream.asp 2>/dev/null | grep "TAG_UPC_T38" | cut -f 23 -d ">" | cut -f 1 -d "<")
    echo -e "Downstream power levels:\n$DOWNSTREAM\n"
    echo -e "Upstream power levels:\n$UPSTREAM"
    wget -O - http://192.168.100.1/logout.asp > /dev/null 2>&1

    [ Szerkesztve ]

    Alex

Új hozzászólás Aktív témák