fix(post-boot): improve error handling with non-critical failure messages
- commit
- d24ff914ff4a5393677baff68fac5e854d940b9c
- author
- bnema · · 2025-10-21 17:01 UTC
- parent
- 93f3a7e
- signature
- unsigned
1 file · +15 -5
M install/post-boot/all.sh +15 -5
| @@ -1,8 +1,6 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | # ArchUp First Boot - Post-boot tasks that require running system | |
| 3 | 3 | ||
| 4 | - | set -e | |
| 5 | - | ||
| 6 | 4 | LOG_FILE="/var/log/archup-first-boot.log" | |
| 7 | 5 | ||
| 8 | 6 | echo "=== ArchUp First Boot Setup - $(date) ===" > "$LOG_FILE" | |
| @@ -10,19 +8,31 @@ echo "=== ArchUp First Boot Setup - $(date) ===" > "$LOG_FILE" | |||
| 10 | 8 | # Run snapper configuration | |
| 11 | 9 | if [ -f /usr/local/share/archup/post-boot/snapper.sh ]; then | |
| 12 | 10 | echo "Configuring snapper..." | tee -a "$LOG_FILE" | |
| 13 | - | bash /usr/local/share/archup/post-boot/snapper.sh >> "$LOG_FILE" 2>&1 | |
| 11 | + | if bash /usr/local/share/archup/post-boot/snapper.sh >> "$LOG_FILE" 2>&1; then | |
| 12 | + | echo "✓ Snapper configured successfully" | tee -a "$LOG_FILE" | |
| 13 | + | else | |
| 14 | + | echo "✗ Snapper configuration failed (non-critical)" | tee -a "$LOG_FILE" | |
| 15 | + | fi | |
| 14 | 16 | fi | |
| 15 | 17 | ||
| 16 | 18 | # Run SSH key generation | |
| 17 | 19 | if [ -f /usr/local/share/archup/post-boot/ssh-keygen.sh ]; then | |
| 18 | 20 | echo "Generating SSH keys..." | tee -a "$LOG_FILE" | |
| 19 | - | bash /usr/local/share/archup/post-boot/ssh-keygen.sh >> "$LOG_FILE" 2>&1 | |
| 21 | + | if bash /usr/local/share/archup/post-boot/ssh-keygen.sh >> "$LOG_FILE" 2>&1; then | |
| 22 | + | echo "✓ SSH keys generated successfully" | tee -a "$LOG_FILE" | |
| 23 | + | else | |
| 24 | + | echo "✗ SSH key generation failed (non-critical)" | tee -a "$LOG_FILE" | |
| 25 | + | fi | |
| 20 | 26 | fi | |
| 21 | 27 | ||
| 22 | 28 | # Install archup-cli from GitHub | |
| 23 | 29 | if [ -f /usr/local/share/archup/post-boot/archup-cli.sh ]; then | |
| 24 | 30 | echo "Installing archup-cli from GitHub..." | tee -a "$LOG_FILE" | |
| 25 | - | bash /usr/local/share/archup/post-boot/archup-cli.sh >> "$LOG_FILE" 2>&1 | |
| 31 | + | if bash /usr/local/share/archup/post-boot/archup-cli.sh >> "$LOG_FILE" 2>&1; then | |
| 32 | + | echo "✓ archup-cli installed successfully" | tee -a "$LOG_FILE" | |
| 33 | + | else | |
| 34 | + | echo "✗ archup-cli installation failed (non-critical)" | tee -a "$LOG_FILE" | |
| 35 | + | fi | |
| 26 | 36 | fi | |
| 27 | 37 | ||
| 28 | 38 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | |
| @@ -1,8 +1,6 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | # ArchUp First Boot - Post-boot tasks that require running system | 2 | # ArchUp First Boot - Post-boot tasks that require running system | ||
| 3 | 3 | ||||
| 4 | - | set -e | |||
| 5 | - | ||||
| 6 | LOG_FILE="/var/log/archup-first-boot.log" | 4 | LOG_FILE="/var/log/archup-first-boot.log" | ||
| 7 | 5 | ||||
| 8 | echo "=== ArchUp First Boot Setup - $(date) ===" > "$LOG_FILE" | 6 | echo "=== ArchUp First Boot Setup - $(date) ===" > "$LOG_FILE" | ||
| @@ -10,19 +8,31 @@ echo "=== ArchUp First Boot Setup - $(date) ===" > "$LOG_FILE" | |||||
| 10 | # Run snapper configuration | 8 | # Run snapper configuration | ||
| 11 | if [ -f /usr/local/share/archup/post-boot/snapper.sh ]; then | 9 | if [ -f /usr/local/share/archup/post-boot/snapper.sh ]; then | ||
| 12 | echo "Configuring snapper..." | tee -a "$LOG_FILE" | 10 | echo "Configuring snapper..." | tee -a "$LOG_FILE" | ||
| 13 | - | bash /usr/local/share/archup/post-boot/snapper.sh >> "$LOG_FILE" 2>&1 | 11 | + | if bash /usr/local/share/archup/post-boot/snapper.sh >> "$LOG_FILE" 2>&1; then |
| 12 | + | echo "✓ Snapper configured successfully" | tee -a "$LOG_FILE" | |||
| 13 | + | else | |||
| 14 | + | echo "✗ Snapper configuration failed (non-critical)" | tee -a "$LOG_FILE" | |||
| 15 | + | fi | |||
| 14 | fi | 16 | fi | ||
| 15 | 17 | ||||
| 16 | # Run SSH key generation | 18 | # Run SSH key generation | ||
| 17 | if [ -f /usr/local/share/archup/post-boot/ssh-keygen.sh ]; then | 19 | if [ -f /usr/local/share/archup/post-boot/ssh-keygen.sh ]; then | ||
| 18 | echo "Generating SSH keys..." | tee -a "$LOG_FILE" | 20 | echo "Generating SSH keys..." | tee -a "$LOG_FILE" | ||
| 19 | - | bash /usr/local/share/archup/post-boot/ssh-keygen.sh >> "$LOG_FILE" 2>&1 | 21 | + | if bash /usr/local/share/archup/post-boot/ssh-keygen.sh >> "$LOG_FILE" 2>&1; then |
| 22 | + | echo "✓ SSH keys generated successfully" | tee -a "$LOG_FILE" | |||
| 23 | + | else | |||
| 24 | + | echo "✗ SSH key generation failed (non-critical)" | tee -a "$LOG_FILE" | |||
| 25 | + | fi | |||
| 20 | fi | 26 | fi | ||
| 21 | 27 | ||||
| 22 | # Install archup-cli from GitHub | 28 | # Install archup-cli from GitHub | ||
| 23 | if [ -f /usr/local/share/archup/post-boot/archup-cli.sh ]; then | 29 | if [ -f /usr/local/share/archup/post-boot/archup-cli.sh ]; then | ||
| 24 | echo "Installing archup-cli from GitHub..." | tee -a "$LOG_FILE" | 30 | echo "Installing archup-cli from GitHub..." | tee -a "$LOG_FILE" | ||
| 25 | - | bash /usr/local/share/archup/post-boot/archup-cli.sh >> "$LOG_FILE" 2>&1 | 31 | + | if bash /usr/local/share/archup/post-boot/archup-cli.sh >> "$LOG_FILE" 2>&1; then |
| 32 | + | echo "✓ archup-cli installed successfully" | tee -a "$LOG_FILE" | |||
| 33 | + | else | |||
| 34 | + | echo "✗ archup-cli installation failed (non-critical)" | tee -a "$LOG_FILE" | |||
| 35 | + | fi | |||
| 26 | fi | 36 | fi | ||
| 27 | 37 | ||||
| 28 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | 38 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | ||