From 5d331e4e223a8a92a3f0566fdf02c0a4ce669e5b Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Sat, 21 Jan 2023 19:15:21 +0530 Subject: [PATCH] add a section to setup network connection --- scripts/pratham-setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/pratham-setup.sh b/scripts/pratham-setup.sh index 2554fcc..9b72615 100755 --- a/scripts/pratham-setup.sh +++ b/scripts/pratham-setup.sh @@ -29,6 +29,12 @@ if [[ ! $WHAT_IS_MY_TZ =~ "Asia/Kolkata" ]]; then WHAT_IS_MY_TZ=whoopsie fi +ETH_DEV_NAME=$(nmcli connection show | grep ethernet | choose -f " " 0) +nmcli connection show "$ETH_DEV_NAME" | grep "ipv4.dns:" | grep "1.1.1.2,1.0.0.2" || nmcli connection modify "$ETH_DEV_NAME" ipv4.dns "1.1.1.2,1.0.0.2" +nmcli connection show "$ETH_DEV_NAME" | grep "ipv4.ignore-auto-dns" | grep "yes" || nmcli connection modify "$ETH_DEV_NAME" ipv4.ignore-auto-dns yes +doas nmcli connection reload "$ETH_DEV_NAME" + + # reboot to bring hostname in effect if [[ $WHAT_IS_MY_TZ == "whoopsie" || $WHAT_IS_MY_HOSTNAME == "whoopsie" ]]; then systemctl reboot