fix(install.sh): MULTIROOM_AGENT in Drop-in statt Haupt-Unit — überlebt gateway install
This commit is contained in:
+10
-8
@@ -988,14 +988,6 @@ UNIT_FILE="$HOME/.config/systemd/user/hermes-gateway.service"
|
||||
if [ -f "$UNIT_FILE" ]; then
|
||||
# Replace ExecStart to use "gateway run" instead of "run_agent.py gateway"
|
||||
sed -i 's|ExecStart=.*|ExecStart='"$PYTHON"' -m hermes_cli.main gateway run|' "$UNIT_FILE"
|
||||
# Multi-Room-Flag als Environment-Variable in der Unit setzen
|
||||
if [ "$RC_MULTIROOM" = "true" ]; then
|
||||
if ! grep -q "^Environment=MULTIROOM_AGENT=" "$UNIT_FILE" 2>/dev/null; then
|
||||
sed -i '/^ExecStart=.*/a Environment=MULTIROOM_AGENT=true' "$UNIT_FILE"
|
||||
else
|
||||
sed -i 's|^Environment=MULTIROOM_AGENT=.*|Environment=MULTIROOM_AGENT=true|' "$UNIT_FILE"
|
||||
fi
|
||||
fi
|
||||
systemctl --user daemon-reload 2>/dev/null || true
|
||||
fi
|
||||
|
||||
@@ -1010,6 +1002,16 @@ if [ -f "$SCRIPT_DIR/templates/hermes-gateway-env.conf" ]; then
|
||||
msg env_dropin
|
||||
fi
|
||||
|
||||
# Multi-Room-Flag als Environment-Variable im Drop-in setzen
|
||||
# (Drop-in überlebt 'hermes gateway install', Haupt-Unit wird überschrieben)
|
||||
if [ "$RC_MULTIROOM" = "true" ]; then
|
||||
if ! grep -q "^Environment=MULTIROOM_AGENT=" "$DROPDIN_FILE" 2>/dev/null; then
|
||||
echo "Environment=MULTIROOM_AGENT=true" >> "$DROPDIN_FILE"
|
||||
else
|
||||
sed -i 's|^Environment=MULTIROOM_AGENT=.*|Environment=MULTIROOM_AGENT=true|' "$DROPDIN_FILE"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Ensure lingering is enabled (may need sudo — best-effort)
|
||||
loginctl enable-linger 2>/dev/null || true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user