Commit 24a3e9b0 authored by Lisa (AI Assistant)'s avatar Lisa (AI Assistant)

Fix init script: use global python, executable mcp_server.py with shebang

parent a06cfc34
......@@ -12,9 +12,7 @@
NAME=clawphone
DESC="ClawPhone MCP Server"
PIDFILE=/var/run/$NAME.pid
DAEMON=/usr/bin/python3
DAEMON_SCRIPT=/home/share/clawphone/mcp_server.py
DAEMON_USER=root
DAEMON=/home/share/clawphone/mcp_server.py
DIR=/home/share/clawphone
ENV_FILE=/etc/default/clawphone
......@@ -32,7 +30,7 @@ if [ -f "$ENV_FILE" ]; then
[ -n "$CERT" ] && DAEMON_ARGS="$DAEMON_ARGS --cert $CERT"
[ -n "$KEY" ] && DAEMON_ARGS="$DAEMON_ARGS --key $KEY"
[ -n "$LOG_DIR" ] && DAEMON_ARGS="$DAEMON_ARGS --log-dir $LOG_DIR"
[ -n "$SYSLOG" ] && [ "$SYSLOG" = "1" ] && DAEMON_ARGS="$DAEMON_ARGS --syslog"
[ "$SYSLOG" = "1" ] && DAEMON_ARGS="$DAEMON_ARGS --syslog"
[ -n "$TOKEN" ] && DAEMON_ARGS="$DAEMON_ARGS --token $TOKEN"
# Export for the Python script
......@@ -68,12 +66,12 @@ case "$1" in
# Start daemon with arguments
cd $DIR
start-stop-daemon --start --pidfile $PIDFILE --make-pidfile \
--background --chuid $DAEMON_USER --chdir $DIR \
--startas $DAEMON -- $DAEMON_SCRIPT $DAEMON_ARGS
--background --chdir $DIR \
--startas $DAEMON -- $DAEMON_ARGS
# Wait for server to start and show token
sleep 2
if [ -f "$DB" ]; then
if [ -n "$DB" ] && [ -f "$DB" ]; then
TOKEN=$(sqlite3 "$DB" "SELECT value FROM config WHERE key='server_token';" 2>/dev/null)
if [ -n "$TOKEN" ]; then
echo ""
......
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment