#!/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="$(dirname "${0}" | sed "s|^\.|${PWD}|")" 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 WIFI_NAME nmcli --ask device wifi connect ${WIFI_NAME} cat << EOF Network configured Press any key to return to the main menu EOF read -srn 1