1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-24 20:38:36 -06:00

chg: Open portal page automatically and renamed

This commit is contained in:
Sayantan Santra 2024-12-06 22:57:38 -06:00
parent 17506c39ab
commit af2baca9a9
Signed by: SinTan1729
GPG key ID: 0538DD402EA50898

View file

@ -3,6 +3,8 @@
# 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
set -e
# Get the DNS resolver provided by the network
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 "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..."