26 lines
728 B
Bash
Executable File
26 lines
728 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SERVICE_NAME=asset-tracker.service
|
|
SRC_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
SRC_FILE="$SRC_DIR/$SERVICE_NAME"
|
|
DST_FILE="/etc/systemd/system/$SERVICE_NAME"
|
|
ENV_FILE="/root/.openclaw/workspace/asset-tracker/.env.production"
|
|
|
|
if [[ ! -f "$SRC_FILE" ]]; then
|
|
echo "missing $SRC_FILE"
|
|
exit 1
|
|
fi
|
|
|
|
install -m 0644 "$SRC_FILE" "$DST_FILE"
|
|
systemctl daemon-reload
|
|
|
|
if [[ ! -f "$ENV_FILE" ]]; then
|
|
cp /root/.openclaw/workspace/asset-tracker/.env.production.example "$ENV_FILE"
|
|
echo "Created $ENV_FILE from example. Please set JWT_SECRET before start."
|
|
fi
|
|
|
|
echo "Installed $DST_FILE"
|
|
echo "Next: edit $ENV_FILE and set strong JWT_SECRET"
|
|
echo "Then run: systemctl enable --now asset-tracker"
|