Community discussions

MikroTik App
 
lordkiehl
just joined
Topic Author
Posts: 1
Joined: Thu Jul 19, 2018 4:49 pm

Auto login site using fetch

Thu Jul 19, 2018 5:09 pm

since i change my device from openwrt to mikrotik
in previous router i using bash script for auto login site, I try convert bash script to mikrotik
i wonder is this already correct ? since i only read from Manual:Tools/Fetch

Code: Select all

#!/bin/bash
# Check ip from isp
ipwan=$(ifconfig | grep -A 2 'wlan0' | awk '/inet addr/{print substr($2,6)}')
# Test Connection
if ping -q -c 1 -W 1 8.8.8.8 >/dev/null;
then
echo "The network is up"
else
echo "The network is down"
# Login
wget --post-data="username=lordkiehl@freeMS&password=pa$$wrd" "http://welcome2.wifi.id/wms/auth/authnew/autologin/quarantine.php?ipc="$ipwan"&gw_id=WAG-D4-KBU&client_mac=xx:b4:29:d8:xx:ce&wlan=SLOGLD00371/TLK-WI31477992-0001:UN%20CHECK" -O /dev/null
fi


i try execute this on mikrotik scripting but unable to login

Code: Select all

:local ip [/ip address get [/ip address find interface="wlan1"] address];
:local ip [put [:pick $ip 0 [:find $ip "/"]]]

/tool fetch http-method=post http-data="username=lordkiehl@freeMS&password=pa$$wd" url=("http://welcome2.wifi.id/wms/auth/authnew/autologin/quarantine.php\?ipc=$ip&gw_id=WAG-D4-KBU&client_mac=xx:xx:xx:xx:xx:xx&wlan=SLOGLD00371/TLK-WI31477992-0001:UN%20CHECK") keep-result=no
Thank you before
sorry for miss spell or wrong grammar
 
tentaralangit
just joined
Posts: 2
Joined: Tue Jan 22, 2019 2:41 pm

Re: Auto login site using fetch

Wed Jan 23, 2019 8:41 am

Please help..

I have an ISP internet connection where to get an internet connection I have to connect to a hotspot and when connected, a login page will appear and must enter a username and password and a new login I get an internet connection after logging in. I use RB951Hap to connect to my ISP hotspot using the Wlan interfaces on Rb951.

My problem is to log in with a 1-month voucher. I have to edit the default url where the default url is "https://welcome2.wifi.id/wms/?gw_id=WAG ... Bu%20Yayun"

and I have to change to the url "https://welcome2.wifi.id/login/auth/aut ... Bu%20Yayun"

I previously used your auto login script

but this script can only point to the default login page

what script code, which can redirect from the default login page url to the url "https://welcome2.wifi.id/login/auth/aut ... Bu%20Yayun"
and mikrotik I can auto login.

thank you

Who is online

Users browsing this forum: No registered users and 27 guests