Quiet first boot installer output

This commit is contained in:
Jino Jose 2026-06-30 16:01:59 +05:30
parent 87b1d63a26
commit 910e5d1499
2 changed files with 19 additions and 10 deletions

View File

@ -8,8 +8,10 @@ set -e
AIPACKAGE_DIR="/opt/aipackage"
LOG_FILE="/var/log/cezen-setup.log"
INSTALL_LOG_FILE="/var/log/cezen-install.log"
export TERM="${TERM:-linux}"
exec > >(tee -a "$LOG_FILE") 2>&1
touch "$LOG_FILE" "$INSTALL_LOG_FILE"
chmod 0644 "$LOG_FILE" "$INSTALL_LOG_FILE"
detect_iface() {
ip route show default 2>/dev/null | awk '/default/ {print $5; exit}'
@ -254,12 +256,19 @@ PY
chown root:cezen /opt/cezen/license.json 2>/dev/null || true
chmod 0640 /opt/cezen/license.json
# Mark as configured so this wizard doesn't run again
touch /opt/cezen/.setup-done
# Run the installer
bash "$AIPACKAGE_DIR/install.sh" --tier="$TIER"
whiptail --title "$TITLE" \
--msgbox "\nInstaller command finished.\n\nFor detailed logs, run:\n sudo journalctl -u cezen-phase2.service -f\n sudo tail -f /var/log/cezen-install.log" \
--infobox "\nInstalling Nexus One AI stack...\n\nThis can take several minutes.\n\nLogs are being written to:\n $INSTALL_LOG_FILE" \
$H $W
if bash "$AIPACKAGE_DIR/install.sh" --tier="$TIER" >> "$INSTALL_LOG_FILE" 2>&1; then
# Mark as configured only after the installer finishes successfully.
touch /opt/cezen/.setup-done
whiptail --title "$TITLE" \
--msgbox "\nInstaller command finished successfully.\n\nPortal:\n http://localhost\n\nFor detailed logs, run:\n sudo tail -f $INSTALL_LOG_FILE" \
$H $W
else
whiptail --title "$TITLE" \
--msgbox "\nInstaller command failed.\n\nThe setup wizard will run again on next boot.\n\nCheck the log with:\n sudo tail -n 120 $INSTALL_LOG_FILE" \
$H $W
exit 1
fi

View File

@ -222,8 +222,8 @@ Wants=network-online.target
Type=oneshot
ExecStart=/bin/bash -lc 'set -o pipefail; /bin/bash ${SCRIPT_DIR}/install.sh --phase=2 --tier=${TIER} 2>&1 | tee -a /var/log/cezen-install.log'
RemainAfterExit=yes
StandardOutput=journal+console
StandardError=journal+console
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target