feat: add initconfig + setup.sh to Linux packages, combine tar.gz

This commit is contained in:
2026-07-20 12:23:58 +08:00
parent e9e2e6b823
commit 3a3149b2e2
3 changed files with 173 additions and 26 deletions

View File

@ -2,7 +2,7 @@
set -e
SERVICE_NAME="homeagent"
SERVICE_FILE="/etc/systemd/system/${SERVICE_NAME}.service"
SERVICE_FILE="/lib/systemd/system/${SERVICE_NAME}.service"
HOMED_BIN="/usr/bin/homed"
DATA_DIR="/var/lib/homeagent"
@ -11,8 +11,15 @@ case "$1" in
if [ -f "$HOMED_BIN" ]; then
mkdir -p "$DATA_DIR"
# 初始化凭据和数据库
if [ -x /usr/lib/homeagent/setup.sh ]; then
HOMEAGENT_DATA="$DATA_DIR" /usr/lib/homeagent/setup.sh || true
fi
# 注册 systemd 服务
if [ -f "$SERVICE_FILE" ]; then
systemctl daemon-reload 2>/dev/null || true
systemctl enable "$SERVICE_NAME" 2>/dev/null || true
fi
fi
;;