FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Zyxel keenetic
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Zyxel keenetic
Posted: Tue Mar 09, 2021 05:42 PM

There is an Internet center Zyxel keenetic. I need to programmatically reload it.
Can I do this via FW or do I need to use Telnet ?

Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
Re: Zyxel keenetic
Posted: Thu Mar 11, 2021 12:03 PM

Hi Natter!

Please, could you specify the model and what you want to do?

TIA!

Best regards,

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Zyxel keenetic
Posted: Thu Mar 11, 2021 02:39 PM

The router says Zyxel Keenetic 3G/4G with an access point WI-FI 802,11n 150Mb and Ethernet switch
I need to programmatically reload it. Firmware is old-2.04
In the new firmware, it seems, there is such an option. In this case, you need your own script

I tried using Telnet - it doesn't work, there is no access.
It looks like Telnet access is disabled in the router itself. Apparently I need to try to insert my script into the router via FTP

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Zyxel keenetic
Posted: Thu Mar 11, 2021 03:53 PM

Hello Natter,
what do you mean with "reload"? Do you mean restart the ACCESSPOINT?
Best regards,
Otto

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Zyxel keenetic
Posted: Thu Mar 11, 2021 04:41 PM

Sorry. I meant Restart !

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Zyxel keenetic
Posted: Thu Mar 11, 2021 05:50 PM
Hello Natter,
maybe these functions are of any help.

I restarted with these functions TPLink ACCESSPoints every night.

Best regards,
Otto




Code (fw): Select all Collapse
FUNCTION    AP_Resetten()
    local cUser := ""
    local cIP   := ""
    local cPW   := ""
    local cvar  := ""
    local cPWobfuscator := pw_obfuscator()
   *----------------------------------------------------------  
    
    use "c:\xWHSystem\doku\NETWORK.DBF" new
    
    //xbrowse()
    
    do while .not. eof()
    
        if ALLTRIM( field->ART ) = "AP-TPLink"

            ? FIELD->ip + FIELD->room 
            //? Decrypt( FIELD->USERNAME, cPWobfuscator )
            //? Decrypt( FIELD->PASSWORD, cPWobfuscator )

            cUser := ALLTRIM( Decrypt( FIELD->USERNAME, cPWobfuscator ) )
            cIP   := ALLTRIM( FIELD->ip )
            cPW   := ALLTRIM( Decrypt( FIELD->PASSWORD, cPWobfuscator ) )
            
            PING_tplinkAP(cIP)
            
            cVar := 'c:\_temp\curl.exe --user ' + cUser +':' + cPW + ' "http://' + cIP + '/userRpm/SysRebootRpm.htm?&wan=1&Reboot=Reboot"'
        
            logfile( "reset.log", {   cVar } )
        
            //  MEMOWRIT2( 'http.bat', cVar )
            sysrefresh()
        
            msgwait(cvar, , 1 )
            

            WINEXEC( cVar )
        endif

        skip
    
    enddo
    
    use
    msginfo( "TP Link AccessPoints wurden resettet" )

return NIL
//----------------------------------------------------------------------------//

function pw_obfuscator()
   local cPassword1 := "W"
   local cPassword2 := "H"
   local cPassword3 := "A"
   local cFiller    := "xyz"
   local cPassword4 := "d"
   local cPassword5 := "v"
   local cFiller1   := "abi"
   local cPassword6 := "v"
   local cPassword7 := "n"
   local cPassword8 := ""
   *----------------------------------------------------------

return ( cPassword1 + cPassword2 +  cPassword3 + cPassword4 + cPassword5 +  cPassword6 + cPassword7 + cPassword8 )
//----------------------------------------------------------------------------//


function PING_tplinkAP( cIP )
    local cPing1    := ""
    local cVar     := ""
    local cTXTFILE := ""
    
     cTXTFILE := STRTRAN(cIP, ".", "_"  )
    
    cVar := "PING " + cIP + " -n 100 >PING_" + cTXTFILE + ".txt" + CRLF
    
    MEMOWRIT2( 'ping1.bat', cVar )
    
    winexec  ('ping1.bat' )

    //msginfo(cPing1)

return nil
//----------------------------------------------------------------------------//

Continue the discussion