0% found this document useful (0 votes)
160 views

Wifi Id Script

The document contains scripts to check and maintain a WiFi connection. It pings a main ISP to check the connection, and if unsuccessful, tries pinging again. If still unsuccessful, it releases the DHCP client and retries connection by fetching a login URL with IP, MAC, and credentials. If ping to 8.8.8.8 fails, it also releases DHCP, retries connection, and checks if @wifi.id is up after reconnect attempt.

Uploaded by

Akhyar Rosyidi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
160 views

Wifi Id Script

The document contains scripts to check and maintain a WiFi connection. It pings a main ISP to check the connection, and if unsuccessful, tries pinging again. If still unsuccessful, it releases the DHCP client and retries connection by fetching a login URL with IP, MAC, and credentials. If ping to 8.8.8.8 fails, it also releases DHCP, retries connection, and checks if @wifi.id is up after reconnect attempt.

Uploaded by

Akhyar Rosyidi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

:local pingcount 3

:local ip [/ip address get [/ip address find interface="ether1"] address];


:local macadd [/interface ether get [ find default-name=ether1 ] mac-address];
:local ip [put [:pick $ip 0 [:find $ip "/"]]];

:log warning "IP DHCP = $ip - MAC = $macadd";

:local CheckMainISP [/ping 10.165.0.1 src-address=$ip count=$pingcount];


:if ($CheckMainISP>0) do={
:log warning "PING $CheckMainISP - OK - WIFI.ID LAN terhubung...";
} else {
:log error "PING kurang stabil - mencoba PING lagi...";
:local ping2 [/ping 10.165.0.1 src-address=$ip count=$pingcount];

:if ($ping2>0) do={


:log warning "PING $ping2 - OK - WIFI.ID LANterhubung...";
/tool fetch http-header-field="User-Agent:Mozilla/4.0" http-method=post http-
data="username=91736063292430@spin2&password=hsw"
url="https://welcome2.wifi.id/authnew/login/check_login.php\?ipc=$ip&gw_id=WAG-D5-
KLM&mac=$macadd&redirect=http://8.8.8.8/&wlan=" keep-result=no;
} else {
:log error ("Mencoba login WIFI.ID LAN...");
/ip dns cache flush
/ip dhcp-client release [find interface=ether1]
log warning ("NEW DHCP CLIENT")
delay 10

:local ip [/ip address get [/ip address find interface="ether1"] address];


:local macadd [/interface ether get [ find default-name=ether1 ] mac-address];
:local ip [put [:pick $ip 0 [:find $ip "/"]]];
:log error ("Gagal Mulai login Ulang WIFI.ID LAN...");
/tool fetch http-header-field="User-Agent:Mozilla/4.0" http-method=post http-
data="username=91736063292430@spin2&password=hsw"
url="https://welcome2.wifi.id/authnew/login/check_login.php\?ipc=$ip&gw_id=WAG-D5-
KLM&mac=$macadd&redirect=http://8.8.8.8/&wlan=" keep-result=no;
:beep frequency=4000 length=500ms;

}
}

:if ([/ping address=8.8.8.8 count=2] = 0) do={


/ip dns cache flush
/ip dhcp-client release [find interface=ether2-indihome]
log warning ("NEW DHCP CLIENT")
delay 10
log error ("@wifi.id is down --- trying to reconnect ......")
:local ip [/ip address get [/ip address find interface="ether2-indihome"] address];
:local ip [put [:pick $ip 0 [:find $ip "/"]]];
/tool fetch http-header-field="User-Agent: Mozilla/4.0" http-method=post http-
data="username=91736063292430@spin2&password=hsw"
url=("https://welcome2.wifi.id/authnew/login/check_login.php\?ipc=$ip&gw_id=WAG-D5-
KLM&client_mac=&wlan=") keep-result=no;
} else {
log warning ("@wifi.id sudah UP Bosku")
}
([/ping address=8.8.8.8 count=2] = 0) do={
/ip dns cache flush
/ip dhcp-client release [find interface=ether2-indihome]
log warning ("NEW DHCP CLIENT")
delay 10
log error ("@wifi.id is down --- trying to reconnect ......")
:local ip [/ip address get [/ip address find interface="ether2-indihome"] address];
:local ip [put [:pick $ip 0 [:find $ip "/"]]];
/tool fetch http-header-field="User-Agent: Mozilla/4.0" http-method=post http-
data="username=91736063292430@spin2&password=hsw"
url=("https://welcome2.wifi.id/authnew/login/check_login.php\?ipc=$ip&gw_id=WAG-D5-
KLM&client_mac=&wlan=") keep-result=no;
} else {
log warning (

log error ("Gagal Mulai login Ulang WIFI.ID LAN...")


:local ip [/ip address get [/ip address find interface="ether1"] address];
:local mac [/interface ether get [ find name=ether1 ] mac-address];
:local ip [put [:pick $ip 0 [:find $ip "/"]]];
/tool fetch http-header-field="User-Agent:Mozilla/4.0" http-
data="username=9853372205511@spin2&password=ske"
url=("https://welcome2.wifi.id/authnew/login/check_login.php\?ipc=$ip&gw_id=WAG-D5-
KLM&client_mac=$mac&wlan=") keep-result=no;
}

:local ip [/ip address get [/ip address find interface="ether1"] address];


:local macadd [/interface ether get [ find default-name=ether1 ] mac-address];
:local ip [put [:pick $ip 0 [:find $ip "/"]]];
:log error ("Gagal Mulai login Ulang WIFI.ID LAN...");
/tool fetch http-header-field="User-Agent:Mozilla/4.0" http-method=post http-
data="username=9853372205511@spin2&password=ske"
url="https://welcome2.wifi.id/authnew/login/check_login.php\?ipc=$ip&gw_id=WAG-D5-
KLM&mac=$macadd&redirect=http://8.8.8.8/&wlan=" keep-result=no;
:beep frequency=4000 length=500ms;

You might also like