mirror of
https://github.com/SinTan1729/random.git
synced 2024-12-25 20:58:37 -06:00
chg: Open portal page automatically and renamed
This commit is contained in:
parent
17506c39ab
commit
af2baca9a9
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,8 @@
|
||||||
# This script allows one to log into captive portals by temporarily using the provided DNS records. Otherwise, captive portals
|
# 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
|
# don't work with custom resolvconf setups
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
# Get the DNS resolver provided by the network
|
# Get the DNS resolver provided by the network
|
||||||
DNS=$(nmcli -f IP4.DNS dev show wlan0 | awk '{print $2}' | head -1)
|
DNS=$(nmcli -f IP4.DNS dev show wlan0 | awk '{print $2}' | head -1)
|
||||||
|
|
||||||
|
@ -12,7 +14,8 @@ 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 "# Temporary resolv.conf generated by captive-portal-login.sh" | sudo tee /etc/resolv.conf
|
||||||
echo "nameserver $DNS" | sudo tee -a /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."
|
echo "Put temporary DNS resolver in place. Fix the captive portal before continuing."
|
||||||
|
xdg-open 1.1.1.1
|
||||||
|
|
||||||
read -p "Press enter to continue..."
|
read -p "Press enter to continue..."
|
||||||
|
|
Loading…
Reference in a new issue