Quiet first boot installer output
This commit is contained in:
parent
87b1d63a26
commit
910e5d1499
@ -8,8 +8,10 @@ set -e
|
|||||||
|
|
||||||
AIPACKAGE_DIR="/opt/aipackage"
|
AIPACKAGE_DIR="/opt/aipackage"
|
||||||
LOG_FILE="/var/log/cezen-setup.log"
|
LOG_FILE="/var/log/cezen-setup.log"
|
||||||
|
INSTALL_LOG_FILE="/var/log/cezen-install.log"
|
||||||
export TERM="${TERM:-linux}"
|
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() {
|
detect_iface() {
|
||||||
ip route show default 2>/dev/null | awk '/default/ {print $5; exit}'
|
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
|
chown root:cezen /opt/cezen/license.json 2>/dev/null || true
|
||||||
chmod 0640 /opt/cezen/license.json
|
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" \
|
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
|
$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
|
||||||
|
|||||||
@ -222,8 +222,8 @@ Wants=network-online.target
|
|||||||
Type=oneshot
|
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'
|
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
|
RemainAfterExit=yes
|
||||||
StandardOutput=journal+console
|
StandardOutput=journal
|
||||||
StandardError=journal+console
|
StandardError=journal
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user