Fix systemd service: put Environment directives on separate lines
This commit is contained in:
1 parent
c6167b8107
commit
894881aa10
1 file changed
+7
-4
@@ -108,10 +108,12 @@ done
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Build environment variables string for systemd
|
# Build environment variables for systemd (each on its own line)
|
||||||
ENV_VARS="Environment=MCP_SERVER_URL=${SERVER_URL}"
|
ENV_MCP="Environment=MCP_SERVER_URL=${SERVER_URL}"
|
||||||
if [ -n "$API_KEY" ]; then
|
if [ -n "$API_KEY" ]; then
|
||||||
ENV_VARS="$ENV_VARS Environment=IMPLANT_API_KEY=${API_KEY}"
|
ENV_API="Environment=IMPLANT_API_KEY=${API_KEY}"
|
||||||
|
else
|
||||||
|
ENV_API=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create systemd service file
|
# Create systemd service file
|
||||||
@@ -127,7 +129,8 @@ Wants=network-online.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/python3 ${SCRIPT_DIR}/implant.py --id ${IMPLANT_ID} --interval ${INTERVAL}
|
ExecStart=/usr/bin/python3 ${SCRIPT_DIR}/implant.py --id ${IMPLANT_ID} --interval ${INTERVAL}
|
||||||
${ENV_VARS}
|
${ENV_MCP}
|
||||||
|
${ENV_API}
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
User=root
|
User=root
|
||||||
|
|||||||
Reference in new issue
Block a user