mirror of
https://github.com/SinTan1729/random.git
synced 2024-12-26 05:08:36 -06:00
Compare commits
2 commits
d486b3a614
...
9437266fb2
Author | SHA1 | Date | |
---|---|---|---|
9437266fb2 | |||
897464d8d1 |
2 changed files with 21 additions and 0 deletions
21
captive-portal-login.sh
Normal file
21
captive-portal-login.sh
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/env bash
|
||||
|
||||
# This script allows one to log into captive portals by temporarily using the provided DNS records. Otherwise, captive portals
|
||||
# don't work with custom resolvconf setups
|
||||
|
||||
# Get the DNS resolver provided by the network
|
||||
DNS=$(nmcli -f IP4.DNS dev show wlan0 | awk '{print $2}')
|
||||
|
||||
# Temporarily put the DNS resolver in place
|
||||
echo "Need sudo permission to work with /etc/resolv.conf"
|
||||
sudo cp /etc/resolv.conf /etc/resolv.conf.bk
|
||||
echo "# Temporary resolv.conf generated by captive-portal-login.sh" | sudo tee /etc/resolv.conf
|
||||
echo "nameserver $DNS" | sudo tee -a /etc/resolv.conf
|
||||
|
||||
echo "Put temporary DNS resolver in place. Now try opening an website, and fix the captive portal before continuing."
|
||||
|
||||
read -p "Press enter to continue..."
|
||||
|
||||
# Put back own resolvers
|
||||
sudo mv /etc/resolv.conf.bk /etc/resolv.conf
|
||||
|
0
update-aur-lure.sh
Executable file → Normal file
0
update-aur-lure.sh
Executable file → Normal file
Loading…
Reference in a new issue