From ca258c186248420c6d25af57e83be38185b71b05 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sun, 4 Feb 2024 11:25:03 +0100 Subject: [PATCH] Finalize migration from gitea to forgejo --- n/forgejo-bin/SlackBuild | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/n/forgejo-bin/SlackBuild b/n/forgejo-bin/SlackBuild index 8749bf16..20a99c1f 100755 --- a/n/forgejo-bin/SlackBuild +++ b/n/forgejo-bin/SlackBuild @@ -75,45 +75,26 @@ CMD="/usr/bin/forgejo" # user used to run the daemon USERNAME=forgejo -# Process name of daemon, for killing it. -PROCESSNAME=\$CMD - # Option to run with deamon OPTIONS=" --config /etc/forgejo/app.ini" -PIDFILE=/var/lib/forgejo/forgejo.pid +func_status() { + pgrep -u \$USERNAME forgejo && echo Running || echo Stopped +} func_stop() { - [ -e \$PIDFILE ] && kill \$(cat \$PIDFILE) - rm \$PIDFILE + pkill -u \$USERNAME forgejo - if [ ! "\$(pgrep forgejo)" ]; then - echo "Error!" - else - echo "Stopped!" - fi + func_status } func_start() { echo -n "Starting \$NAME ... " su - \$USERNAME -c "\$CMD \$OPTIONS" & - echo \$\$ > \$PIDFILE sleep 2 - if [ "\$(pgrep forgejo)" ]; then - echo "Started!" - else - echo "Error!" - fi -} - -func_status() { - if [ "\$(pgrep forgejo)" ]; then - echo "Running!" - else - echo "NOT running!" - fi + func_status }