refactor(post-boot): remove stdout output from first-boot service logging
- commit
- 0f21d5d9bdc94158e4236d15d2488fe4921d153d
- author
- bnema · · 2025-10-28 18:03 UTC
- committer
- bnema · · 2025-10-28 21:41 UTC
- parent
- bc09266
- signature
- unsigned
3 files · +19 -28
M install/post-boot/all.sh +17 -26
| @@ -9,68 +9,59 @@ if [ -f /usr/local/share/archup/logo.txt ]; then | |||
| 9 | 9 | echo "" | |
| 10 | 10 | fi | |
| 11 | 11 | ||
| 12 | - | echo "=== ArchUp First Boot Setup - $(date) ===" | tee "$LOG_FILE" | |
| 13 | - | echo "" | |
| 12 | + | echo "=== ArchUp First Boot Setup - $(date) ===" >> "$LOG_FILE" | |
| 14 | 13 | ||
| 15 | 14 | # Run snapper configuration | |
| 16 | 15 | if [ -f /usr/local/share/archup/post-boot/snapper.sh ]; then | |
| 17 | - | echo "Configuring snapper..." | tee -a "$LOG_FILE" | |
| 16 | + | echo "Configuring snapper..." >> "$LOG_FILE" | |
| 18 | 17 | if bash /usr/local/share/archup/post-boot/snapper.sh >> "$LOG_FILE" 2>&1; then | |
| 19 | - | echo "Snapper configured successfully" | tee -a "$LOG_FILE" | |
| 18 | + | echo "Snapper configured successfully" >> "$LOG_FILE" | |
| 20 | 19 | else | |
| 21 | - | echo "Snapper configuration failed (non-critical)" | tee -a "$LOG_FILE" | |
| 20 | + | echo "Snapper configuration failed (non-critical)" >> "$LOG_FILE" | |
| 22 | 21 | fi | |
| 23 | 22 | fi | |
| 24 | 23 | ||
| 25 | 24 | # Configure UFW firewall | |
| 26 | 25 | if [ -f /usr/local/share/archup/post-boot/ufw.sh ]; then | |
| 27 | - | echo "Configuring firewall..." | tee -a "$LOG_FILE" | |
| 26 | + | echo "Configuring firewall..." >> "$LOG_FILE" | |
| 28 | 27 | if bash /usr/local/share/archup/post-boot/ufw.sh >> "$LOG_FILE" 2>&1; then | |
| 29 | - | echo "Firewall configured successfully" | tee -a "$LOG_FILE" | |
| 28 | + | echo "Firewall configured successfully" >> "$LOG_FILE" | |
| 30 | 29 | else | |
| 31 | - | echo "Firewall configuration failed (non-critical)" | tee -a "$LOG_FILE" | |
| 30 | + | echo "Firewall configuration failed (non-critical)" >> "$LOG_FILE" | |
| 32 | 31 | fi | |
| 33 | 32 | fi | |
| 34 | 33 | ||
| 35 | 34 | # Run SSH key generation | |
| 36 | 35 | if [ -f /usr/local/share/archup/post-boot/ssh-keygen.sh ]; then | |
| 37 | - | echo "Generating SSH keys..." | tee -a "$LOG_FILE" | |
| 36 | + | echo "Generating SSH keys..." >> "$LOG_FILE" | |
| 38 | 37 | if bash /usr/local/share/archup/post-boot/ssh-keygen.sh >> "$LOG_FILE" 2>&1; then | |
| 39 | - | echo "✓ SSH keys generated successfully" | tee -a "$LOG_FILE" | |
| 38 | + | echo "[OK] SSH keys generated successfully" >> "$LOG_FILE" | |
| 40 | 39 | else | |
| 41 | - | echo "✗ SSH key generation failed (non-critical)" | tee -a "$LOG_FILE" | |
| 40 | + | echo "[KO] SSH key generation failed (non-critical)" >> "$LOG_FILE" | |
| 42 | 41 | fi | |
| 43 | 42 | fi | |
| 44 | 43 | ||
| 45 | 44 | # Install archup-cli from GitHub | |
| 46 | 45 | if [ -f /usr/local/share/archup/post-boot/archup-cli.sh ]; then | |
| 47 | - | echo "Installing archup-cli from GitHub..." | tee -a "$LOG_FILE" | |
| 46 | + | echo "Installing archup-cli from GitHub..." >> "$LOG_FILE" | |
| 48 | 47 | if bash /usr/local/share/archup/post-boot/archup-cli.sh >> "$LOG_FILE" 2>&1; then | |
| 49 | - | echo "✓ archup-cli installed successfully" | tee -a "$LOG_FILE" | |
| 48 | + | echo "[OK] archup-cli installed successfully" >> "$LOG_FILE" | |
| 50 | 49 | else | |
| 51 | - | echo "✗ archup-cli installation failed (non-critical)" | tee -a "$LOG_FILE" | |
| 50 | + | echo "[KO] archup-cli installation failed (non-critical)" >> "$LOG_FILE" | |
| 52 | 51 | fi | |
| 53 | 52 | fi | |
| 54 | 53 | ||
| 55 | 54 | # Install ble.sh (Bash Line Editor) | |
| 56 | 55 | if [ -f /usr/local/share/archup/post-boot/blesh.sh ]; then | |
| 57 | - | echo "Installing ble.sh (Bash Line Editor)..." | tee -a "$LOG_FILE" | |
| 56 | + | echo "Installing ble.sh (Bash Line Editor)..." >> "$LOG_FILE" | |
| 58 | 57 | if bash /usr/local/share/archup/post-boot/blesh.sh >> "$LOG_FILE" 2>&1; then | |
| 59 | - | echo "✓ ble.sh installed successfully" | tee -a "$LOG_FILE" | |
| 58 | + | echo "[OK] ble.sh installed successfully" >> "$LOG_FILE" | |
| 60 | 59 | else | |
| 61 | - | echo "✗ ble.sh installation failed (non-critical)" | tee -a "$LOG_FILE" | |
| 60 | + | echo "[KO] ble.sh installation failed (non-critical)" >> "$LOG_FILE" | |
| 62 | 61 | fi | |
| 63 | 62 | fi | |
| 64 | 63 | ||
| 65 | 64 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | |
| 66 | 65 | ||
| 67 | 66 | # Disable this service after first run | |
| 68 | - | systemctl disable archup-first-boot.service | |
| 69 | - | ||
| 70 | - | echo "" | |
| 71 | - | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| 72 | - | echo " ✓ ArchUp is ready!" | |
| 73 | - | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| 74 | - | echo "" | |
| 75 | - | echo " Next: Run 'archup wizard' to configure your system" | |
| 76 | - | echo "" | |
| 67 | + | systemctl disable archup-first-boot.service >> "$LOG_FILE" 2>&1 | |
| @@ -9,68 +9,59 @@ if [ -f /usr/local/share/archup/logo.txt ]; then | |||||
| 9 | echo "" | 9 | echo "" | ||
| 10 | fi | 10 | fi | ||
| 11 | 11 | ||||
| 12 | - | echo "=== ArchUp First Boot Setup - $(date) ===" | tee "$LOG_FILE" | 12 | + | echo "=== ArchUp First Boot Setup - $(date) ===" >> "$LOG_FILE" |
| 13 | - | echo "" | |||
| 14 | 13 | ||||
| 15 | # Run snapper configuration | 14 | # Run snapper configuration | ||
| 16 | if [ -f /usr/local/share/archup/post-boot/snapper.sh ]; then | 15 | if [ -f /usr/local/share/archup/post-boot/snapper.sh ]; then | ||
| 17 | - | echo "Configuring snapper..." | tee -a "$LOG_FILE" | 16 | + | echo "Configuring snapper..." >> "$LOG_FILE" |
| 18 | if bash /usr/local/share/archup/post-boot/snapper.sh >> "$LOG_FILE" 2>&1; then | 17 | if bash /usr/local/share/archup/post-boot/snapper.sh >> "$LOG_FILE" 2>&1; then | ||
| 19 | - | echo "Snapper configured successfully" | tee -a "$LOG_FILE" | 18 | + | echo "Snapper configured successfully" >> "$LOG_FILE" |
| 20 | else | 19 | else | ||
| 21 | - | echo "Snapper configuration failed (non-critical)" | tee -a "$LOG_FILE" | 20 | + | echo "Snapper configuration failed (non-critical)" >> "$LOG_FILE" |
| 22 | fi | 21 | fi | ||
| 23 | fi | 22 | fi | ||
| 24 | 23 | ||||
| 25 | # Configure UFW firewall | 24 | # Configure UFW firewall | ||
| 26 | if [ -f /usr/local/share/archup/post-boot/ufw.sh ]; then | 25 | if [ -f /usr/local/share/archup/post-boot/ufw.sh ]; then | ||
| 27 | - | echo "Configuring firewall..." | tee -a "$LOG_FILE" | 26 | + | echo "Configuring firewall..." >> "$LOG_FILE" |
| 28 | if bash /usr/local/share/archup/post-boot/ufw.sh >> "$LOG_FILE" 2>&1; then | 27 | if bash /usr/local/share/archup/post-boot/ufw.sh >> "$LOG_FILE" 2>&1; then | ||
| 29 | - | echo "Firewall configured successfully" | tee -a "$LOG_FILE" | 28 | + | echo "Firewall configured successfully" >> "$LOG_FILE" |
| 30 | else | 29 | else | ||
| 31 | - | echo "Firewall configuration failed (non-critical)" | tee -a "$LOG_FILE" | 30 | + | echo "Firewall configuration failed (non-critical)" >> "$LOG_FILE" |
| 32 | fi | 31 | fi | ||
| 33 | fi | 32 | fi | ||
| 34 | 33 | ||||
| 35 | # Run SSH key generation | 34 | # Run SSH key generation | ||
| 36 | if [ -f /usr/local/share/archup/post-boot/ssh-keygen.sh ]; then | 35 | if [ -f /usr/local/share/archup/post-boot/ssh-keygen.sh ]; then | ||
| 37 | - | echo "Generating SSH keys..." | tee -a "$LOG_FILE" | 36 | + | echo "Generating SSH keys..." >> "$LOG_FILE" |
| 38 | if bash /usr/local/share/archup/post-boot/ssh-keygen.sh >> "$LOG_FILE" 2>&1; then | 37 | if bash /usr/local/share/archup/post-boot/ssh-keygen.sh >> "$LOG_FILE" 2>&1; then | ||
| 39 | - | echo "✓ SSH keys generated successfully" | tee -a "$LOG_FILE" | 38 | + | echo "[OK] SSH keys generated successfully" >> "$LOG_FILE" |
| 40 | else | 39 | else | ||
| 41 | - | echo "✗ SSH key generation failed (non-critical)" | tee -a "$LOG_FILE" | 40 | + | echo "[KO] SSH key generation failed (non-critical)" >> "$LOG_FILE" |
| 42 | fi | 41 | fi | ||
| 43 | fi | 42 | fi | ||
| 44 | 43 | ||||
| 45 | # Install archup-cli from GitHub | 44 | # Install archup-cli from GitHub | ||
| 46 | if [ -f /usr/local/share/archup/post-boot/archup-cli.sh ]; then | 45 | if [ -f /usr/local/share/archup/post-boot/archup-cli.sh ]; then | ||
| 47 | - | echo "Installing archup-cli from GitHub..." | tee -a "$LOG_FILE" | 46 | + | echo "Installing archup-cli from GitHub..." >> "$LOG_FILE" |
| 48 | if bash /usr/local/share/archup/post-boot/archup-cli.sh >> "$LOG_FILE" 2>&1; then | 47 | if bash /usr/local/share/archup/post-boot/archup-cli.sh >> "$LOG_FILE" 2>&1; then | ||
| 49 | - | echo "✓ archup-cli installed successfully" | tee -a "$LOG_FILE" | 48 | + | echo "[OK] archup-cli installed successfully" >> "$LOG_FILE" |
| 50 | else | 49 | else | ||
| 51 | - | echo "✗ archup-cli installation failed (non-critical)" | tee -a "$LOG_FILE" | 50 | + | echo "[KO] archup-cli installation failed (non-critical)" >> "$LOG_FILE" |
| 52 | fi | 51 | fi | ||
| 53 | fi | 52 | fi | ||
| 54 | 53 | ||||
| 55 | # Install ble.sh (Bash Line Editor) | 54 | # Install ble.sh (Bash Line Editor) | ||
| 56 | if [ -f /usr/local/share/archup/post-boot/blesh.sh ]; then | 55 | if [ -f /usr/local/share/archup/post-boot/blesh.sh ]; then | ||
| 57 | - | echo "Installing ble.sh (Bash Line Editor)..." | tee -a "$LOG_FILE" | 56 | + | echo "Installing ble.sh (Bash Line Editor)..." >> "$LOG_FILE" |
| 58 | if bash /usr/local/share/archup/post-boot/blesh.sh >> "$LOG_FILE" 2>&1; then | 57 | if bash /usr/local/share/archup/post-boot/blesh.sh >> "$LOG_FILE" 2>&1; then | ||
| 59 | - | echo "✓ ble.sh installed successfully" | tee -a "$LOG_FILE" | 58 | + | echo "[OK] ble.sh installed successfully" >> "$LOG_FILE" |
| 60 | else | 59 | else | ||
| 61 | - | echo "✗ ble.sh installation failed (non-critical)" | tee -a "$LOG_FILE" | 60 | + | echo "[KO] ble.sh installation failed (non-critical)" >> "$LOG_FILE" |
| 62 | fi | 61 | fi | ||
| 63 | fi | 62 | fi | ||
| 64 | 63 | ||||
| 65 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | 64 | echo "=== First Boot Setup Complete ===" >> "$LOG_FILE" | ||
| 66 | 65 | ||||
| 67 | # Disable this service after first run | 66 | # Disable this service after first run | ||
| 68 | - | systemctl disable archup-first-boot.service | 67 | + | systemctl disable archup-first-boot.service >> "$LOG_FILE" 2>&1 |
| 69 | - | ||||
| 70 | - | echo "" | |||
| 71 | - | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |||
| 72 | - | echo " ✓ ArchUp is ready!" | |||
| 73 | - | echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |||
| 74 | - | echo "" | |||
| 75 | - | echo " Next: Run 'archup wizard' to configure your system" | |||
| 76 | - | echo "" | |||
M install/post-boot/archup-cli.sh +1 -1
| @@ -35,7 +35,7 @@ BINARY_PATH="${GOBIN}/archup-cli" | |||
| 35 | 35 | ||
| 36 | 36 | # Verify installation | |
| 37 | 37 | if [ -x "$BINARY_PATH" ]; then | |
| 38 | - | echo "✓ archup-cli installed successfully" | |
| 38 | + | echo "[OK] archup-cli installed successfully" | |
| 39 | 39 | echo " Location: $BINARY_PATH" | |
| 40 | 40 | echo " Version: $($BINARY_PATH --version 2>/dev/null || echo 'unknown')" | |
| 41 | 41 | echo "" | |
| @@ -35,7 +35,7 @@ BINARY_PATH="${GOBIN}/archup-cli" | |||||
| 35 | 35 | ||||
| 36 | # Verify installation | 36 | # Verify installation | ||
| 37 | if [ -x "$BINARY_PATH" ]; then | 37 | if [ -x "$BINARY_PATH" ]; then | ||
| 38 | - | echo "✓ archup-cli installed successfully" | 38 | + | echo "[OK] archup-cli installed successfully" |
| 39 | echo " Location: $BINARY_PATH" | 39 | echo " Location: $BINARY_PATH" | ||
| 40 | echo " Version: $($BINARY_PATH --version 2>/dev/null || echo 'unknown')" | 40 | echo " Version: $($BINARY_PATH --version 2>/dev/null || echo 'unknown')" | ||
| 41 | echo "" | 41 | echo "" | ||
M install/post-boot/blesh.sh +1 -1
| @@ -48,6 +48,6 @@ EOF | |||
| 48 | 48 | # Cleanup | |
| 49 | 49 | rm -rf /tmp/ble.sh | |
| 50 | 50 | ||
| 51 | - | echo "✓ ble.sh installed successfully" | |
| 51 | + | echo "[OK] ble.sh installed successfully" | |
| 52 | 52 | echo " Location: $BLESH_INSTALL_DIR/share/blesh" | |
| 53 | 53 | echo " Note: ble.sh will be active on next shell session" | |
| @@ -48,6 +48,6 @@ EOF | |||||
| 48 | # Cleanup | 48 | # Cleanup | ||
| 49 | rm -rf /tmp/ble.sh | 49 | rm -rf /tmp/ble.sh | ||
| 50 | 50 | ||||
| 51 | - | echo "✓ ble.sh installed successfully" | 51 | + | echo "[OK] ble.sh installed successfully" |
| 52 | echo " Location: $BLESH_INSTALL_DIR/share/blesh" | 52 | echo " Location: $BLESH_INSTALL_DIR/share/blesh" | ||
| 53 | echo " Note: ble.sh will be active on next shell session" | 53 | echo " Note: ble.sh will be active on next shell session" | ||