Files
Key-service-Server/setup-stack-autostart.sh
T
Aiirondev_dev d9b812812f Refactor and streamline project setup and management scripts
- Removed `run.sh` and `test.sh` scripts to simplify the project structure.
- Added `setup-first-install.sh` to handle initial setup tasks with options to skip specific steps.
- Updated `invario-stack-autostart.service` to use `gitea.sh` for starting the stack on boot.
- Removed `start-stack-on-boot.sh` as its functionality is now integrated into the service.
- Enhanced `admin_system.html` with a new live logs panel, including automatic updates and log source selection.
- Improved CSS styles for the new logs panel for better UI consistency.
- Added JavaScript functionality to fetch and display live logs from the server.
2026-04-18 20:09:44 +02:00

27 lines
723 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SERVICE_NAME="invario-stack-autostart"
SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service"
SERVICE_TEMPLATE="$SCRIPT_DIR/${SERVICE_NAME}.service"
if [[ "${EUID}" -ne 0 ]]; then
echo "This script must be run as root. Use: sudo $0"
exit 1
fi
if [[ ! -f "$SERVICE_TEMPLATE" ]]; then
echo "Missing service template: $SERVICE_TEMPLATE"
exit 1
fi
cp "$SERVICE_TEMPLATE" "$SERVICE_FILE"
chmod 644 "$SERVICE_FILE"
systemctl daemon-reload
systemctl enable "$SERVICE_NAME.service"
echo "Autostart installed. Start it now with: systemctl start $SERVICE_NAME"
echo "Check status with: systemctl status $SERVICE_NAME"