Enhance first-boot.sh and one-shot scripts for improved logging and error handling: add detailed logging to track download successes and failures, implement structured logging in set-rotation-once.sh and set-wallpaper-once.sh, and ensure user permissions for log file access. Update package installation and kiosk file setup processes for better clarity and reliability.
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
#!/bin/bash
|
||||
# One-shot: set desktop wallpaper to splash image, then remove self. Runs as user pi at first login.
|
||||
# Logs to /var/log/first-boot.log (same as first-boot.sh).
|
||||
FIRST_BOOT_LOG="/var/log/first-boot.log"
|
||||
log() { echo "[$(date -Iseconds)] [set-wallpaper-once] $*" >> "$FIRST_BOOT_LOG" 2>/dev/null || true; }
|
||||
|
||||
export DISPLAY=:0
|
||||
log "started (DISPLAY=$DISPLAY)"
|
||||
log "waiting 8s for desktop ..."
|
||||
sleep 8
|
||||
WALLPAPER="/usr/share/rpd-wallpaper/splash.png"
|
||||
[[ -f "$WALLPAPER" ]] && plasma-apply-wallpaperimage "$WALLPAPER" 2>/dev/null || true
|
||||
if [[ -f "$WALLPAPER" ]]; then
|
||||
log "applying wallpaper $WALLPAPER"
|
||||
plasma-apply-wallpaperimage "$WALLPAPER" 2>&1 | while read -r line; do log "$line"; done
|
||||
else
|
||||
log "WARNING: wallpaper not found $WALLPAPER"
|
||||
fi
|
||||
log "removing one-shot desktop and script"
|
||||
rm -f /home/pi/.config/autostart/set-wallpaper-once.desktop /home/pi/set-wallpaper-once.sh
|
||||
log "finished"
|
||||
|
||||
Reference in New Issue
Block a user