Skip to content
Permalink
Browse files

Finalize Queue Restarter

  • Loading branch information...
Insax committed Aug 6, 2017
1 parent 8d2a1ad commit aea17b93642230db86c6b32b1abfe6d87c3ccac9
Showing with 1 addition and 39 deletions.
  1. +1 −39 StartQHandler.sh
@@ -1,47 +1,9 @@
#!/bin/bash

THIS_FULLPATH=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd -P)/`basename "${BASH_SOURCE[0]}"`
THIS_FOLDERPATH=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd -P)

Q_BIN="php artisan queue:work --queue=convert,download --tries=1"
Q_SRC=downloadnconvert

QPATH=/var/www/pr0verter.de



startQ()
{
if [ "$(screen -ls | grep $Q_SCR)" ]
then
echo The Q is is already running!
else
cd $QPATH
screen -AmdS $Q_SCR $THIS_FULLPATH $Q_BIN
echo $Q_SCR Queue is alive!
fi
}

stopQ()
{
screen -S $Q_SCR -X kill &>/dev/null
echo $Q_SCR Queue shutdowned!
}

while x=1;
do
./$Q_BIN
$Q_BIN
sleep 1
done
;;
"start" )
startQ
;;
"stop" )
stopQ()
;;
* )
echo Invalid Argument
echo "usage: start | stop"
exit 1
;;

0 comments on commit aea17b9

Please sign in to comment.
You can’t perform that action at this time.