<message>Update the _set_golden_from_path function to improve the handling of existing golden image files. Replace the existing unlink logic with a more robust method that safely removes files or broken symlinks using the missing_ok parameter. This change enhances the reliability of the backup upload process by ensuring that stale references are properly cleared before setting a new golden image path.
20 lines
842 B
Bash
20 lines
842 B
Bash
#!/bin/bash
|
|
# Example bootstrap script run by cloud-init at first boot.
|
|
# Copy to bootstrap.sh, edit as needed, and place in your portal files (e.g. first-boot/)
|
|
# so it is served at http://YOUR_SERVER:5000/files/bootstrap.sh
|
|
#
|
|
# Cloud-init downloads this and runs it as root. Add your first-boot logic here:
|
|
# - Install packages, apply config, run first-boot.sh from this repo, etc.
|
|
|
|
set -e
|
|
echo "[$(date -Iseconds)] Bootstrap script started."
|
|
|
|
# Example: run the full first-boot flow from your file server (same as user-data-remote-gnss.example)
|
|
# FILE_SERVER="http://10.20.50.1:5000/files/first-boot"
|
|
# curl -fsSL "$FILE_SERVER/first-boot.sh" -o /tmp/first-boot.sh
|
|
# curl -fsSL "$FILE_SERVER/first-boot.conf" -o /tmp/first-boot.conf
|
|
# chmod +x /tmp/first-boot.sh
|
|
# /tmp/first-boot.sh
|
|
|
|
echo "[$(date -Iseconds)] Bootstrap script finished."
|