From 897464d8d1901d6919c6a1a4655e92383274b82a Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Mon, 2 Sep 2024 12:35:33 -0500 Subject: [PATCH] new: Added captive-portal-login.sh --- captive-portal-login.sh | 20 ++++++++++++++++++++ update-aur-lure.sh | 0 2 files changed, 20 insertions(+) create mode 100644 captive-portal-login.sh mode change 100755 => 100644 update-aur-lure.sh diff --git a/captive-portal-login.sh b/captive-portal-login.sh new file mode 100644 index 0000000..c9d0f51 --- /dev/null +++ b/captive-portal-login.sh @@ -0,0 +1,20 @@ +#!/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 +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 + diff --git a/update-aur-lure.sh b/update-aur-lure.sh old mode 100755 new mode 100644