#!/bin/bash set -euo pipefail # This could help with Fedora's DNS resolution: # # resolvectl status | grep 'Link' | sed -e 's|^.*(||g; s|).*||g' | while read -r INTERFACE; do resolvectl dns ${INTERFACE} 9.9.9.9; done && sleep 3 && nmcli device status | grep -v 'DEVICE' | grep -v 'lo' | sed -e 's| .*||g' | while read -r INTERFACE; do nmcli device disconnect ${INTERFACE}; sleep 1; nmcli device connect ${INTERFACE}; done baseDir="$(realpath "$(dirname "${0}")")" cat << EOF ####################################### ## ## ## $(cat "${baseDir}/title") Script ## ## ## ## Jean ## ## ## ####################################### ############# ## ## ## Wi-Fi ## ## Setup ## ## ## ############# EOF nmcli radio wifi on nmcli device wifi list printf "Enter the SSID of the WiFi network you wish to connect to:\n" read -r wifiName nmcli --ask device wifi connect "${wifiName}" cat << EOF Network configured Press any key to return to the main menu EOF read -srn 1