[X2Go-Dev] /usr/sbin/x2gocleansessions does not properly quit
Stefan Baur
newsgroups.mail2 at stefanbaur.de
Mon Aug 27 10:50:25 CEST 2012
Whoops, sorry. Not enough caffeine this morning.
Am 27.08.2012 10:39, schrieb Stefan Baur:
> Hi Mike, das ist Bash und nicht Perl, und außerdem nicht sonderlich
> hübsch, aber vielleicht als Anregung...
This translates to: "Hi Mike, this is Bash, not Perl, and not exactly
elegant, but might serve as an inspiration.
>
> #!/bin/bash
> PSOUTPUT=$(ps --no-headers -C $(basename $0))
> COUNT=$(echo -e "$PSOUTPUT" | wc -l)
> if [ "$COUNT" -gt "1" ] ; then
> echo "Already running."
> exit 1
> else
> echo "Running..."
> sleep 30
> echo "Done."
> fi
-Stefan
More information about the x2go-dev
mailing list