mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-09 04:13:38 +02:00
#1371 change detecting existing WIFI config
This commit is contained in:
1
FAQ.md
1
FAQ.md
@@ -23,6 +23,7 @@
|
|||||||
- New: ZeroTier [details](https://zerotier.com/manual/)
|
- New: ZeroTier [details](https://zerotier.com/manual/)
|
||||||
- New: Kindle Display (on a jailbroken Kindle) [details](https://github.com/dennisreimann/kindle-display)
|
- New: Kindle Display (on a jailbroken Kindle) [details](https://github.com/dennisreimann/kindle-display)
|
||||||
- New: Static Channel Backup on USB Thumbdrive [details](https://github.com/rootzoll/raspiblitz/tree/v1.6#c-local-backup-target-usb-thumbdrive)
|
- New: Static Channel Backup on USB Thumbdrive [details](https://github.com/rootzoll/raspiblitz/tree/v1.6#c-local-backup-target-usb-thumbdrive)
|
||||||
|
- New: Keep WIFI config over wpa_supplicant.conf for next update
|
||||||
- Fix: DropBox StaticChannelBackup
|
- Fix: DropBox StaticChannelBackup
|
||||||
- Shoppinglist: 4GB RaspberryPi 4 is now default for Standard Package (will still run with less)
|
- Shoppinglist: 4GB RaspberryPi 4 is now default for Standard Package (will still run with less)
|
||||||
|
|
||||||
|
@@ -37,8 +37,8 @@ function wait_for_local_network() {
|
|||||||
do
|
do
|
||||||
localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | grep 'eth0\|wlan0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
localip=$(ip addr | grep 'state UP' -A2 | egrep -v 'docker0' | grep 'eth0\|wlan0' | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
||||||
if [ ${#localip} -eq 0 ]; then
|
if [ ${#localip} -eq 0 ]; then
|
||||||
doesWIFIconfigExists=$(ls /boot/wpa_supplicant.conf 2>/dev/null| grep -c "wpa_supplicant.conf")
|
configWifiExists=$(sudo cat /etc/wpa_supplicant/wpa_supplicant.conf 2>/dev/null| grep -c "network=")
|
||||||
if [ ${doesWIFIconfigExists} -eq 0 ]; then
|
if [ ${configWifiExists} -eq 0 ]; then
|
||||||
# display user to connect LAN
|
# display user to connect LAN
|
||||||
sed -i "s/^state=.*/state=noIP/g" ${infoFile}
|
sed -i "s/^state=.*/state=noIP/g" ${infoFile}
|
||||||
sed -i "s/^message=.*/message='Connect the LAN/WAN'/g" ${infoFile}
|
sed -i "s/^message=.*/message='Connect the LAN/WAN'/g" ${infoFile}
|
||||||
@@ -343,9 +343,9 @@ if [ ${isMounted} -eq 0 ]; then
|
|||||||
sudo /home/admin/config.scripts/blitz.datadrive.sh link
|
sudo /home/admin/config.scripts/blitz.datadrive.sh link
|
||||||
|
|
||||||
# check if there is a WIFI configuration to restore
|
# check if there is a WIFI configuration to restore
|
||||||
configWifiBoot=$(sudo ls /boot/wpa_supplicant.conf 2>/dev/null| grep -c "wpa_supplicant.conf")
|
configWifiExists=$(sudo cat /etc/wpa_supplicant/wpa_supplicant.conf 2>/dev/null| grep -c "network=")
|
||||||
configWifiHDD=$(sudo ls /mnt/hdd/app-data/wpa_supplicant.conf 2>/dev/null| grep -c "wpa_supplicant.conf")
|
configWifiHDD=$(sudo ls /mnt/hdd/app-data/wpa_supplicant.conf 2>/dev/null| grep -c "wpa_supplicant.conf")
|
||||||
if [ ${configWifiBoot} -eq 0 ] && [ ${configWifiHDD} -eq 1 ]; then
|
if [ ${configWifiExists} -eq 0 ] && [ ${configWifiHDD} -eq 1 ]; then
|
||||||
echo "Restoring WIFI setting & rebooting .." >> $logFile
|
echo "Restoring WIFI setting & rebooting .." >> $logFile
|
||||||
sudo cp /mnt/hdd/app-data/wpa_supplicant.conf /boot/wpa_supplicant.conf
|
sudo cp /mnt/hdd/app-data/wpa_supplicant.conf /boot/wpa_supplicant.conf
|
||||||
sudo chmod 755 /boot/wpa_supplicant.conf
|
sudo chmod 755 /boot/wpa_supplicant.conf
|
||||||
@@ -426,10 +426,10 @@ fi # END - no automount - after this HDD is mounted
|
|||||||
wait_for_local_network
|
wait_for_local_network
|
||||||
|
|
||||||
# if a WIFI config exists backup to HDD
|
# if a WIFI config exists backup to HDD
|
||||||
configWifiBoot=$(sudo ls /boot/wpa_supplicant.conf 2>/dev/null| grep -c "wpa_supplicant.conf")
|
configWifiExists=$(sudo cat /etc/wpa_supplicant/wpa_supplicant.conf 2>/dev/null| grep -c "network=")
|
||||||
if [ ${configWifiBoot} -eq 1 ]; then
|
if [ ${configWifiExists} -eq 1 ]; then
|
||||||
echo "Making Backup Copy of WIFI config to HDD" >> $logFile
|
echo "Making Backup Copy of WIFI config to HDD" >> $logFile
|
||||||
sudo cp /boot/wpa_supplicant.conf /mnt/hdd/app-data/wpa_supplicant.conf
|
sudo cp /etc/wpa_supplicant/wpa_supplicant.conf /mnt/hdd/app-data/wpa_supplicant.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# config should exist now
|
# config should exist now
|
||||||
|
Reference in New Issue
Block a user