]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Test suite: Use $USER in getpid.sh when $LOGNAME is not set
authorAlexander Barton <alex@barton.de>
Sat, 13 Apr 2024 10:00:49 +0000 (12:00 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 13 Apr 2024 10:22:35 +0000 (12:22 +0200)
The LOGNAME environment variable is not set in GitHub "actions", for
example ...

src/testsuite/getpid.sh
src/testsuite/start-server.sh

index 465def64605356d0c74b45a6348f7a1bcde4a8cd..8505914208e68538013bd0777d40d380ccbe2fc7 100755 (executable)
@@ -23,7 +23,7 @@ if [ -x /usr/bin/pgrep ]; then
                *)
                        PGREP_FLAGS=""
        esac
-       exec /usr/bin/pgrep $PGREP_FLAGS -n -u "$LOGNAME" "$1"
+       exec /usr/bin/pgrep $PGREP_FLAGS -n -u "${LOGNAME:-$USER}" "$1"
 fi
 
 # pidof(1) could be a good alternative on elder Linux systems
index 599bf3ad7a5c678c4fb9fa56f126bca21485960c..bc6eb7ea4a0d83f7968ae5844adaa2419b025d45 100755 (executable)
@@ -20,7 +20,7 @@ echo_n "starting server ${id} ..."
 
 # check weather getpid.sh returns valid PIDs. If not, don't start up the
 # test-server, because we won't be able to kill it at the end of the test.
-./getpid.sh sh >/dev/null 2>&1
+./getpid.sh sh >/dev/null
 if [ $? -ne 0 ]; then
        echo " getpid.sh failed!"
        exit 1