fix jokes file and bot
This commit is contained in:
parent
f09dba2c08
commit
54e084a952
|
@ -1,11 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
pid=$(ps -ef | grep BenBot | grep -v grep | awk '{print $2}')
|
# pid=$(ps -ef | grep BenBot | grep -v grep | awk '{print $2}')
|
||||||
|
pid=$(pidof BenBot)
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
||||||
nohup)
|
nohup)
|
||||||
if [ "" == "$pid" ]; then
|
if [ $pid ]; then
|
||||||
echo "starting BenBot in background (nohup)"
|
echo "starting BenBot in background (nohup)"
|
||||||
nohup php run.php > bot.out 2> bot.err < /dev/null &
|
nohup php run.php > bot.out 2> bot.err < /dev/null &
|
||||||
else
|
else
|
||||||
|
@ -14,21 +15,22 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
start)
|
start)
|
||||||
if [ "" != "$pid" ]; then
|
if [ $pid ]; then
|
||||||
kill $pid
|
kill $pid
|
||||||
fi
|
fi
|
||||||
php run.php
|
php run.php
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
if [ "" != "$pid" ]; then
|
if [ $pid ]; then
|
||||||
echo "killing BenBot ($pid)"
|
echo "killing BenBot ($pid)"
|
||||||
kill $pid
|
kill $pid
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
status)
|
status)
|
||||||
if [ "" != "$pid" ]; then
|
#pgrep BenBot && echo "Running"
|
||||||
|
if [ $pid ]; then
|
||||||
echo "BenBot running with pid $pid"
|
echo "BenBot running with pid $pid"
|
||||||
else
|
else
|
||||||
echo "BenBot not running"
|
echo "BenBot not running"
|
||||||
|
@ -36,7 +38,7 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
log)
|
log)
|
||||||
if [ "" != "$pid" ]; then
|
if [ $pid ]; then
|
||||||
less bot.out
|
less bot.out
|
||||||
else
|
else
|
||||||
echo "BenBot not running"
|
echo "BenBot not running"
|
||||||
|
@ -49,7 +51,7 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
restart)
|
restart)
|
||||||
if [ "" != "$pid" ]; then
|
if [ $pid ]; then
|
||||||
echo "killing BenBot ($pid)"
|
echo "killing BenBot ($pid)"
|
||||||
kill $pid
|
kill $pid
|
||||||
fi
|
fi
|
||||||
|
|
1980
miscjokes.txt
1980
miscjokes.txt
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue