Am 27.08.2012 09:39, schrieb Mike Gabriel:
On Mo 27 Aug 2012 02:24:02 CEST Benjamin Shadwick wrote:
- Abort the start of the new instance when a previous running
instance is
detected?
Yes, the lower solution has just appeared on my todo list. If you have
time to provide a patch, feel free to deliver on.
Otherwise, I will see to it during the next couple of days.
Hi Mike, das ist Bash und nicht Perl, und außerdem nicht sonderlich
hübsch, aber vielleicht als Anregung...
#!/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
Gruß
Stefan
_______________________________________________
X2Go-Dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/x2go-dev