Fix order 🐒

This commit is contained in:
Dmitri Popov
2017-08-14 11:28:15 +02:00
parent dc4da95cbe
commit 2ba3057764

View File

@@ -36,6 +36,17 @@ until [ ! -z $CARD_READER ]
CARD_READER=$(ls /dev/sd* | grep $CARD_DEV | cut -d"/" -f3) CARD_READER=$(ls /dev/sd* | grep $CARD_DEV | cut -d"/" -f3)
done done
# If there is a wpa_supplicant.conf file in the root of the storage device
# Rename the original config file,
# move wpa_supplicant.conf from the card to /etc/wpa_supplicant/
# Reboot to enable networking
if [ -f "$STORAGE_MOUNT_POINT/wpa_supplicant.conf" ]; then
sudo sh -c "echo 100 > /sys/class/leds/led0/delay_on"
mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.bak
mv "$STORAGE_MOUNT_POINT/wpa_supplicant.conf" /etc/wpa_supplicant/wpa_supplicant.conf
reboot
fi
# If the card reader is detected, mount it and obtain its UUID # If the card reader is detected, mount it and obtain its UUID
if [ ! -z $CARD_READER ]; then if [ ! -z $CARD_READER ]; then
mount /dev/$CARD_DEV $CARD_MOUNT_POINT mount /dev/$CARD_DEV $CARD_MOUNT_POINT
@@ -46,18 +57,6 @@ if [ ! -z $CARD_READER ]; then
< /dev/urandom tr -cd 0-9 | head -c 8 > $CARD_MOUNT_POINT/CARD_ID < /dev/urandom tr -cd 0-9 | head -c 8 > $CARD_MOUNT_POINT/CARD_ID
fi fi
# If there is a wpa_supplicant.conf file in the root of the storage device
# Rename the original config file,
# move wpa_supplicant.conf from the card to /etc/wpa_supplicant/
# Reboot to enable networking
if [ -f "$STORAGE_MOUNT_POINT/wpa_supplicant.conf" ]; then
sudo sh -c "echo 100 > /sys/class/leds/led0/delay_on"
mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.bak
mv "$STORAGE_MOUNT_POINT/wpa_supplicant.conf" /etc/wpa_supplicant/wpa_supplicant.conf
reboot
fi
# Read the 8-digit identifier number from the CARD_ID file on the card # Read the 8-digit identifier number from the CARD_ID file on the card
# and use it as a directory name in the backup path # and use it as a directory name in the backup path
read -r ID < $CARD_MOUNT_POINT/CARD_ID read -r ID < $CARD_MOUNT_POINT/CARD_ID