Monday, 25 January 2021

SCRIP AUTOLOGIN WMS

 netwacth

up

/sys sch disable [find name=wms]

down

/sys sch enable [find name=wms]


script

name : wms

note :

#begin-script#

:local iDebug "true"

:local iFace "wlan1"

:local gwId "WAG-D7-MTR"

:local wlanId "SELSEL00177-N/TLK-CI-77056:RARA%20BEAUTY"

:local userId "XXXXXXXX"

:local passId "XXXXXXXX"

 

:if ($iDebug = "true") do={:log warning "init, release dhcp-client..."};

/ip dns cache flush

/ip dhcp-client release [find interface=$iFace];

:delay 10

:local ipAdd [/ip address get [/ip address find interface=$iFace] address];

:local ipAddr [put [:pick $ipAdd 0 [:find $ipAdd "/"]]];

:local macAddr [/interface wireless get [find default-name=$iFace] mac-address];

:local iUrl ("https://welcome2.wifi.id/wms/auth/authnew/autologin/quarantine.php\?ipc=$ipAddr&gw_id=$gwId&mac=$macAddr&redirect=&wlan=$wlanId&landURL=&username_=$userId&username=$userId.1QWl@freeMS&password=$passId")

/tool fetch http-method=post http-header-field="user-agent: Mozilla/5.0" url="$iUrl" dst-path=wms.txt

:delay 5

:if ($iDebug = "true") do={

 :local iRes [/file get wms.txt contents];

 :log warning $iRes

 :file remove wms.txt

} else={:file remove wms.txt};


scheduler

wms

/sys script run wms