X-Git-Url: https://git.llucax.com/z.facultad/75.08/llamadas.git/blobdiff_plain/87be67dc181732bc1d164f616d0490d8438e0704..7d5d536d23cfcf84b10def316ced75a5df6cb3b1:/inst/afimonio_daemon.sh?ds=inline diff --git a/inst/afimonio_daemon.sh b/inst/afimonio_daemon.sh index 64886a8..ac0fd0c 100755 --- a/inst/afimonio_daemon.sh +++ b/inst/afimonio_daemon.sh @@ -11,16 +11,22 @@ help () { case "$1" in "start") - echo "Iniciando demonio 'afimonio' en modo daemon ..." - nohup "$AFIMONIO_BINDIR/afimonio" & 2>&1 > /dev/null + echo -n "Iniciando demonio 'afimonio' en modo daemon ..." + nohup "$AFIM_BINDIR/afimonio" > /dev/null & + A_PID=`cat "$BASE_DIR/lock/afimonio.pid"` + echo " con PID=$A_PID" ;; "stop") + if ! is_lock "afimonio" ; then + echo "El demonio no esta corriendo ... Abortando" + exit 0 + fi echo "Parando el demonio 'afimonio' ..." - A_PID=`cat "$HOME/lock/afimonio.pid"` + A_PID=`cat "$BASE_DIR/lock/afimonio.pid"` kill $A_PID ;; "status") - A_PID=`cat "$HOME/lock/afimonio.pid"` + A_PID=`cat "$BASE_DIR/lock/afimonio.pid"` if is_lock "afimonio" ; then echo "Afimonio está corriendo actualmente (PID=$A_PID)." else