Update install move NetworkManager reconfigure to end

pull/444/head
Alan Johnston 3 months ago committed by GitHub
parent 1ee0ee3120
commit fd765580c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4,6 +4,7 @@ FLAG=0
checkout=0
BULLSEYE=0
UPDATE=0
NETWORK=1
FILE=/home/pi/CubeSatSim/cubesatsim # code has already been compiled
if [ -f "$FILE" ]; then
@ -166,24 +167,28 @@ if [[ $(grep '11.' /etc/debian_version) ]]; then
if [[ $(sudo systemctl is-active NetworkManager | grep inactive) ]]; then
echo "NetworkManager is inactive"
echo "In order to use the Wi-Fi hotspot, NetworkManager needs to be enabled and configured."
echo "In order to use the Wi-Fi Hotspot, NetworkManager needs to be enabled and configured."
echo
echo "Do you want to re-configure your Wi-Fi (y/n) "
echo "Do you want to enable NetworkManager and re-configure your Wi-Fi (y/n) "
read choice
echo
if [ "$choice" = "y" ] || [ "$choice" = "yes" ] ; then
sudo sed -i 's/managed=false/managed=true/g' /etc/NetworkManager/NetworkManager.conf # allow nmcli to manage WiFi
sudo systemctl disable dhcpcd
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager
NETWORK=0
# sudo sed -i 's/managed=false/managed=true/g' /etc/NetworkManager/NetworkManager.conf # allow nmcli to manage WiFi
# sudo systemctl disable dhcpcd
# sudo systemctl enable NetworkManager
# sudo systemctl start NetworkManager
# sudo nmcli dev wifi connect "$ssid" password "$password"
echo "Enter your Wi-Fi SSID"
read ssid
echo "Enter your Wi-Fi password"
read password
sudo nmcli dev wifi connect "$ssid" password "$password"
echo "Wi-Fi will be updated after reboot"
echo "Wi-Fi will be updated at the end of this install/update. You will need to log back in."
else
echo "Not enabling NetworkManager."
echo "Not enabling NetworkManager. Wi-Fi Hotspot feature will not be available."
fi
fi
@ -1007,6 +1012,16 @@ if [[ $(gpio -v | grep "Pi 5") ]] && [[ ! $(sudo raspi-config nonint get_browser
sudo raspi-config nonint do_browser firefox
fi
if [ "$NETWORK" = "0" ] ; then
echo "Enabling NetworkManager. You will need to login again and restart to complete the install/update."
sudo sed -i 's/managed=false/managed=true/g' /etc/NetworkManager/NetworkManager.conf # allow nmcli to manage WiFi
sudo systemctl disable dhcpcd
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager
sudo nmcli dev wifi connect "$ssid" password "$password"
fi
if [ "$noreboot" = "0" ] ; then
if [ $FLAG -eq 1 ]; then # Not sure if this is needed

Loading…
Cancel
Save

Powered by TurnKey Linux.