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
_______________________________________________
X2Go-Dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/x2go-dev