This commit is contained in:
parent
28f8e5c583
commit
0d1f1e29b5
|
@ -22,7 +22,7 @@ help() {
|
|||
-l debug|info|notice|warning|error
|
||||
Debug level
|
||||
|
||||
-a start|stop|restart
|
||||
-a start|stop|restart|status
|
||||
EOH
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ on_interrupt() {
|
|||
|
||||
start_messenger() {
|
||||
nohup php8.1 bin/console messenger:consume 2>/dev/null >/dev/null &
|
||||
log -t -l notice "Started"
|
||||
}
|
||||
|
||||
stop_messenger() {
|
||||
|
@ -42,6 +43,10 @@ stop_messenger() {
|
|||
log -t -l notice "Stopped"
|
||||
}
|
||||
|
||||
get_pid() {
|
||||
pgrep -f messenger:consume
|
||||
}
|
||||
|
||||
main() {
|
||||
cd "$(dirname "0")"
|
||||
|
||||
|
@ -63,8 +68,10 @@ main() {
|
|||
elif [ "$ACTION" = "restart" ]; then
|
||||
stop_messenger
|
||||
start_messenger
|
||||
elif [ "$ACTION" = "status" ]; then
|
||||
get_pid
|
||||
else
|
||||
log -l error "Action no defined."
|
||||
log -l error "Action is required."
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue