ImmobileBlock Posted February 27, 2016 Share Posted February 27, 2016 I'm put together a shell script to change a mac address and login to a wifi hotspot. I already have one from a while ago #!/bin/bash rfkill block wifi sleep 1 macchanger wlan0 -r sleep 1 rfkill unblock wifi sleep 10 iceweasel xfinity.com sleep 5 xdotool key Tab xdotool key Tab xdotool key Tab xdotool key Tab xdotool key Tab xdotool key Tab xdotool key Tab xdotool key Tab xdotool key KP_Enter sleep 6 xdotool key Tab xdotool key Up xdotool key Tab xdotool key Tab xdotool key Tab xdotool key 1 xdotool key 2 xdotool key 3 xdotool key 4 xdotool key 5 xdotool key Tab xdotool key x xdotool key f xdotool key i xdotool key n xdotool key i xdotool key t xdotool key y xdotool type @ xdotool key g xdotool key m xdotool key a xdotool key i xdotool key l xdotool type . xdotool key c xdotool key o xdotool key m xdotool key Tab xdotool mousemove 458 705 click 1 xdotool key Tab xdotool key Tab sleep 1 xdotool key KP_Enter it pulls up iceweasel then uses xdotool to navigate the page to login. I think I can speed it up and have it run totally in the background using w3m. The home page of the router uses your mac address to generate the "signup link" the link ends up looking something like "https://cable.nnu.com/cablewifi/?client-mac=00:00:00:00:00:00". because I know the structure of what the"signup link" will be I should be able to navigate straight to the to "signup" page and cut out the home page to save time. because I'm using this with macchanger the mac address wont be a constant and is randomly generated. I know that cat /sys/class/net/wlan0/address can get me my current mac how to I get that output to replace the mac in this code w3m https://cable.nnu.com/cablewifi/?client-mac=00:00:00:00:00:00 how do I get the output of one command to the end of another? I saw people using pipes "|" to move the output to the input of other commands. I feel like that's what I'm trying to do but I cant put them together correctly . Is there a better way? I do foresee another problem after this one. I use xdotool to automate the signup for the hotspot right now. When I'm using w3m in a shell in the background xdotool wont work because it acts like keyboard input so it wont affect the shell in the background that's a problem for another day. I just dont know what I should get to know to make this work, ya know? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.