Claude a58c69fb5a Fix version display and backup permission issues
Fixed two issues preventing the Electron update from working properly:

1. Log messages appearing in version output
   - get_latest_electron_version() was outputting log messages to stdout
   - These messages were being captured along with the version number
   - Result: "Target version: [INFO] Fetching...39.2.3" in output
   - Fix: Redirect log_info and log_error to stderr with >&2
   - Now only the version number is captured in the variable

2. Backup function permission errors
   - stat command needed sudo to read owner of restricted directories
   - File checks [ -f ] couldn't access files in drwxr-x--- directories
   - mkdir failed with "cannot create directory '/home/kiosk': Permission denied"
   - Fix: Use sudo for all file operations in create_backup():
     * sudo stat -c '%U' to get directory owner
     * sudo test -f/d for file/directory checks
     * sudo -u owner for mkdir, cp, and file writes

Changes in both update_electron.sh and install_kiosk_0.9.2-6.sh:
- get_latest_electron_version functions: Added >&2 to log statements
- create_backup functions: Added sudo to stat and all file checks
- Ensures backup works with restricted /home/kiosk permissions

The update process should now complete successfully without permission errors
or garbled version output.
2025-11-20 16:32:17 +00:00
S
Description
Mirror of outis1one/ubuntu-based-kiosk from GitHub
GPL-3.0
4.1 MiB
Languages
Shell 94.1%
JavaScript 4.7%
HTML 0.9%
CSS 0.3%