From 25ab04811c2c16fea2975318006a13bf5261f935 Mon Sep 17 00:00:00 2001 From: nagumii Date: Fri, 24 Jan 2025 22:18:54 +0200 Subject: [PATCH 1/6] test --- .../usr/local/bin/femto-runonce.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh index 9be8d16..35b1b95 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh @@ -5,6 +5,9 @@ log_message() { } if grep -qE '^first_boot=false' /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 @@ -22,6 +25,10 @@ Proceed?" 14 60 if [ $? -eq 1 ]; then #if cancel/no exit 0 fi +else + echo "*****************************************" +echo "boot flag is true?" +echo "*****************************************" fi echo -e "\e[32m******* First boot *******\e[0m" @@ -96,7 +103,13 @@ 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 From b1fc816baef861a2447570eb0426166f1c73b316 Mon Sep 17 00:00:00 2001 From: nagumii Date: Fri, 24 Jan 2025 22:32:34 +0200 Subject: [PATCH 2/6] add debug --- .../out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh index 35b1b95..f11dcc0 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh @@ -3,7 +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=false' /etc/femto.conf; then # if not the first boot echo "*****************************************" echo "boot flag is false" From a1015ed3613c3627bd6eb293cd16fcca599da965 Mon Sep 17 00:00:00 2001 From: nagumii Date: Fri, 24 Jan 2025 22:33:47 +0200 Subject: [PATCH 3/6] Update femto.conf --- foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/femto.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/femto.conf b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/femto.conf index c883d77..c682338 100644 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/femto.conf +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/femto.conf @@ -1,2 +1,2 @@ -firstboot=true +first_boot=true act_led=enable \ No newline at end of file From bde2c9b59acf136fde7b554b8ec734e4f8e0bd16 Mon Sep 17 00:00:00 2001 From: nagumii Date: Fri, 24 Jan 2025 22:35:16 +0200 Subject: [PATCH 4/6] Update femto-runonce.sh --- .../out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh index f11dcc0..7d6346c 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh @@ -4,7 +4,7 @@ log_message() { logger "First boot: $1" # Log to the system log } set -x -if grep -qE '^first_boot=false' /etc/femto.conf; then # if not the first boot +if ! grep -qE '^first_boot=true' /etc/femto.conf; then # if not the first boot echo "*****************************************" echo "boot flag is false" echo "*****************************************" From b308e4d6031d1eb66b62df24964db0cb80bbe034 Mon Sep 17 00:00:00 2001 From: nagumii Date: Fri, 24 Jan 2025 22:44:56 +0200 Subject: [PATCH 5/6] Update femto-runonce.sh --- .../usr/local/bin/femto-runonce.sh | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh index 7d6346c..91bc0df 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh @@ -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 From 50fe958cf3f6baf18ea61d35fa0250162d854ff6 Mon Sep 17 00:00:00 2001 From: nagumii Date: Fri, 24 Jan 2025 22:54:56 +0200 Subject: [PATCH 6/6] Update femto-runonce.sh --- .../out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh index 91bc0df..ed07fab 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-runonce.sh @@ -21,7 +21,6 @@ Proceed?" 14 60 if [ $? -eq 1 ]; then #if cancel/no exit 0 fi -else fi echo -e "\e[32m******* First boot *******\e[0m"