wok diff ofono/stuff/etc/init.d/ofono @ rev 18897

syslinux/isohybrid.exe add -r support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 14 22:06:06 2016 +0100 (2016-02-14)
parents 274af13ca754
children 7f188676b59c
line diff
     1.1 --- a/ofono/stuff/etc/init.d/ofono	Sat Nov 02 20:37:08 2013 +0100
     1.2 +++ b/ofono/stuff/etc/init.d/ofono	Sun Feb 14 22:06:06 2016 +0100
     1.3 @@ -13,43 +13,43 @@
     1.4  DESC="Mobile telephony Manager"
     1.5  DAEMON=/usr/sbin/ofonod
     1.6  OPTIONS=$OFONO_OPTIONS
     1.7 -PIDFILE=/run/ofono
     1.8 +PIDFILE=/var/run/ofono.pid
     1.9  
    1.10  case "$1" in
    1.11    start)
    1.12 -    if [ -d $PIDFILE ] ; then
    1.13 +    if active_pidfile $PIDFILE ofonod ; then
    1.14        echo "$NAME already running."
    1.15        exit 1
    1.16      fi
    1.17      echo -n "Starting $DESC: $NAME... "
    1.18      $DAEMON $OPTIONS
    1.19      status
    1.20 +    pidof ofonod > $PIDFILE
    1.21      ;;
    1.22    stop)
    1.23 -    if [ -z "$(pidof ofonod)" ] ; then
    1.24 +    if ! active_pidfile $PIDFILE ofonod ; then
    1.25        echo "$NAME is not running."
    1.26 -	  rm -rf $PIDFILE
    1.27        exit 1
    1.28      fi
    1.29      echo -n "Stopping $DESC: $NAME... "
    1.30 -	rm -rf $PIDFILE
    1.31 -	kill $(pidof ofonod)
    1.32 -	status
    1.33 +    rm -rf $PIDFILE
    1.34 +    kill $(pidof ofonod)
    1.35 +    status
    1.36      ;;
    1.37    restart)
    1.38 -    if [ -z "$(pidof ofonod)" ]; then
    1.39 +    if ! active_pidfile $PIDFILE ofonod ; then
    1.40        echo "$NAME is not running."
    1.41        exit 1
    1.42      fi
    1.43      echo -n "Restarting $DESC: $NAME... "
    1.44 -	rm -rf $PIDFILE
    1.45 +    rm -rf $PIDFILE
    1.46      kill $(pidof ofonod) &&
    1.47      sleep 2 &&
    1.48      $DAEMON $OPTIONS
    1.49      status
    1.50      ;;
    1.51    *)
    1.52 -	printf "\n\033[1mUsage:\033[0m /etc/init.d/%b [start|stop|restart]\n" \
    1.53 +    printf "\n\033[1mUsage:\033[0m /etc/init.d/%b [start|stop|restart]\n" \
    1.54  		"$(basename $0)"
    1.55      exit 1
    1.56      ;;