run once and usb service fixes

I forgot to +x rc local and as a result found some issues
This commit is contained in:
Ruledo 2025-01-20 00:46:48 -08:00
parent 2e8a3f7136
commit 83a95e5c69
4 changed files with 14 additions and 9 deletions

View file

@ -1,17 +1,16 @@
[Unit]
Description=Foxbuntu First Boot
After=meshtasticd.service
Requires=meshtasticd.service
Before=serial-getty@ttyFIQ0.service
DefaultDependencies=no
[Service]
ExecStart=/usr/local/bin/femto-runonce.sh
Type=oneshot
RemainAfterExit=true
Restart=no
StandardOutput=journal+console
StandardError=journal+console
TTYPath=/dev/console
[Install]
WantedBy=serial-getty@ttyFIQ0.service
WantedBy=default.target

View file

@ -1,17 +1,16 @@
[Unit]
Description=Foxbuntu USB Configuration Tool
After=femto-runonce.service meshtasticd.service
After=meshtasticd.service
Before=serial-getty@ttyFIQ0.service
DefaultDependencies=no
[Service]
ExecStart=/usr/local/bin/femto-usb-config-tool.sh
Type=oneshot
RemainAfterExit=true
Restart=no
StandardOutput=journal+console
StandardError=journal+console
TTYPath=/dev/console
[Install]
WantedBy=serial-getty@ttyFIQ0.service
WantedBy=default.target

View file

@ -12,6 +12,12 @@ log_message() {
echo "$(date +"%Y-%m-%d %H:%M:%S") $1" >> /tmp/femtofox-config.log
}
if [ -e "/etc/.firstboot" ]; then
echo "First boot, skipping USB Configuration Tool."
logger "First boot, skipping USB Configuration Tool."
exit 0
fi
exit_script() {
if [ ! -z "$usb_path" ]; then #if usb path is populated
if ! df -T /mnt/usb 2>/dev/null | grep -qw 'ntfs'; then
@ -150,7 +156,8 @@ if [ -f "$mount_point/femtofox-config.txt" ]; then
if [[ -n "$wifi_psk" ]]; then
# Update the psk in the network block
wifi_command="$wifi_command -p \"$wifi_psk\""
log_message "Updating Wi-Fi PSK in wpa_supplicant.conf to \`$wifi_psk\`."
#log_message "Updating Wi-Fi PSK in wpa_supplicant.conf to \`$wifi_psk\`."
log_message "Updating Wi-Fi PSK in wpa_supplicant.conf to *HIDDEN*."
found_config="true"
update_wifi="true"
fi