Better debug command

This commit is contained in:
Fierelier 2024-04-23 15:13:08 +02:00
parent 2010f3ac09
commit 4d24f97baf
2 changed files with 12 additions and 12 deletions

View File

@ -1,9 +1,3 @@
#!/usr/bin/env bash
"$APP" onearg "$@"
"$APP" exist "$1"
source "$APP" service_env "$1"
if ! [ "$SERVICE_RUN" = "" ]; then
SERVICE_RUN_RAW="cd \"$SERVICE_CD\"; echo \"* pwd: \$PWD\"; exec ${SERVICE_RUN//"/\\"}"
echo "* bash: $SERVICE_RUN_RAW"
gosu "$SERVICE_USER" bash -c "$SERVICE_RUN_RAW"
fi
SERVICE_DEBUG=1
source "$APP" start "$1"

View File

@ -21,12 +21,18 @@ if [ "$SERVICE_RUN" = "" ]; then
exit 0
fi
if [ "$SERVICE_DEBUG" = "1" ]; then
SERVICE_RUN_RAW="cd \"$SERVICE_CD\"; echo \"* pwd: \$PWD\"; exec ${SERVICE_RUN//"/\\"}"
echo "* bash: $SERVICE_RUN_RAW"
exec gosu "$SERVICE_USER" bash -c "$SERVICE_RUN_RAW"
else
SERVICE_RUN_RAW="cd \"$SERVICE_CD\"; exec ${SERVICE_RUN//"/\\"}"
if [ "$SERVICE_SCREEN" = "1" ]; then
screen -dmS "$SERVICE_SCREEN_NAME" gosu "$SERVICE_USER" bash -c "$SERVICE_RUN_RAW"
else
gosu "$SERVICE_USER" nohup bash -c "$SERVICE_RUN_RAW" > /dev/null 2>&1 &
fi
fi
if [ -e "$APP_SERVICES/$1/await" ]; then
source "$APP_SERVICES/$1/await"