This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
2016-02-04 16:53:15 +01:00
|
|
|
#!/bin/bash
|
2015-02-18 23:01:52 +01:00
|
|
|
cd $(dirname $0)
|
2016-02-04 16:53:15 +01:00
|
|
|
|
|
|
|
PIDS=""
|
|
|
|
for i in $(ps -awx | grep -i [c]loudbot | sed "s/^\s*//" | cut -d" " -f1); do
|
|
|
|
if [ $i != $$ ]; then
|
|
|
|
PIDS="$i $PIDS"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ ! -z "$PIDS" ]; then
|
|
|
|
kill $PIDS
|
|
|
|
sleep 10
|
|
|
|
kill -9 $PIDS >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
while true
|
2015-02-18 23:01:52 +01:00
|
|
|
do
|
2016-02-04 16:53:15 +01:00
|
|
|
sudo -u cloudbot ./cloudbot.py 2>&1 | logger -s -t $(basename $0)
|
2015-02-18 23:01:52 +01:00
|
|
|
sleep 10
|
|
|
|
done
|
|
|
|
|