Update femto-runonce.sh

This commit is contained in:
nagumii 2025-01-24 22:44:56 +02:00
parent bde2c9b59a
commit b308e4d603

View file

@ -3,11 +3,7 @@ log_message() {
echo -e "\e[32mFirst boot\e[0m: $1" # Echo to the screen
logger "First boot: $1" # Log to the system log
}
set -x
if ! grep -qE '^first_boot=true' /etc/femto.conf; then # if not the first boot
echo "*****************************************"
echo "boot flag is false"
echo "*****************************************"
who | grep -q . || exit 0 # if not logged in, exit script. May not deal well with future web UI
@ -26,9 +22,6 @@ Proceed?" 14 60
exit 0
fi
else
echo "*****************************************"
echo "boot flag is true?"
echo "*****************************************"
fi
echo -e "\e[32m******* First boot *******\e[0m"
@ -103,13 +96,7 @@ fi
#systemctl restart meshtasticd
# remove first boot flag
echo "*****************************************"
cat /etc/femto.conf
echo "*****************************************"
sed -i -E 's/^first_boot=.*/first_boot=false/' /etc/femto.conf
echo "*****************************************"
cat /etc/femto.conf
echo "*****************************************"
log_message "Removing first boot flag and rebooting in 5 seconds..."
sleep 5
reboot