#!/bin/sh
# workaround an issue with ke-recv shutdown state
# (should be done properly when/if ACTDEAD->USER signal comes)

FLAG='/tmp/.restart-ke-recv'

case "$1" in
 start)
   touch $FLAG
 ;;
 stop)
   if [ -e $FLAG ]; then
     /etc/init.d/ke-recv stop
     sleep 1 ;# could be more reliable..
     /etc/init.d/ke-recv start
     rm -f $FLAG
   fi
 ;;
 reload|restart|force-reload)
   echo "$0: not implemented" 
 ;;
 *)
 ;;
esac
