I am working on a Raspberry Pi and using sed to update the SSID and password but the config file requires the SSID and PSK to both be in double quotes. Below is the code I am using but I cannot figure out how to include the double quotes.
script:
#!/bin/bash
read -p "Please specify the Wireless Network SSID: " SSID
echo "$SSID"
sudo sed -i -e"s/^ssid=.*/ssid="$SSID"/" /etc/wpa_supplicant/wpa_supplicant.conf
read -p "Please specify the Wireless Network Password: " WIFIPASS
echo "$WIFIPASS"
sudo sed -i -e"s/^psk=.*/psk="$WIFIPASS"/" /etc/wpa_supplicant/wpa_supplicant.conf
echo "You need to reboot to connect to the internet"
echo "1. Reboot Now?"
echo "2. Exit without Rebooting"
echo -n "Enter your choice: "
read REBOOT
echo
case $REBOOT in
1)
sudo reboot
;;
2)
echo "You will not have internet access until after you reboot!"
;;
0)
echo "Thank You"
;;
esac
Thanks,
Nick