Advertisement
Guest User

opensasc-ng

a guest
Mar 31st, 2010
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.32 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. . /etc/rc.conf
  4. . /etc/rc.d/functions
  5.  
  6. [ -f /etc/conf.d/sasc-ng ] && . /etc/conf.d/sasc-ng
  7.  
  8. PID=$(pidof -o %PPID /usr/sbin/sasc-ng)
  9.  
  10. case $1 in
  11. start)
  12.         stat_busy "Loading dvbloopback kernel module"
  13.  
  14.         [[ -z $DVBLOOPBACK_ARGS ]] && stat_die 1
  15.  
  16.         modprobe dvbloopback $DVBLOOPBACK_ARGS
  17.         sleep 1
  18.  
  19.         stat_done
  20.  
  21.         stat_busy "Starting SASC-NG daemon"
  22.  
  23.         [[ -z $SASCNG_ARGS ]] && stat_die 2
  24.         [[ -z $CAMDIR ]] && stat_die 3
  25.         [[ -z $LOGDIR ]] && stat_die 4
  26.  
  27.         [[ -z $PID ]] && /usr/sbin/sasc-ng -D $SASCNG_ARGS --cam-dir=$CAMDIR -l $LOGDIR/sasc-ng.log
  28.  
  29.         if [ $? -gt 0 ]; then
  30.                 stat_die 5
  31.         else
  32.                 add_daemon sasc-ng
  33.                 stat_done
  34.         fi
  35.         ;;
  36. stop)
  37.         stat_busy "Stoping SASC-NG daemon"
  38.         [[ ! -z $PID ]] && kill $PID &> /dev/null
  39.  
  40.         if [ $? -gt 0 ]; then
  41.                 stat_die 6
  42.         else
  43.                 rm_daemon sasc-ng
  44.                 stat_done
  45.         fi
  46.  
  47.         stat_busy "Unloading dvbloopback kernel module"
  48.  
  49.         sleep 2
  50.         modprobe -r dvbloopback
  51.  
  52.         stat_done
  53.         ;;
  54.  
  55. restart)
  56.         $0 stop
  57.         sleep 1
  58.         $0 start
  59.         ;;
  60.  
  61. *)
  62.         echo "usage: $0 {start|stop|restart}" >&2
  63.         exit 1
  64. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement