Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

opensasc-ng

By: a guest on Mar 31st, 2010  |  syntax: Bash  |  size: 1.32 KB  |  hits: 295  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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