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 ?
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
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 79 guests