Advertisement
Guest User

Untitled

a guest
Sep 9th, 2013
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.35 KB | None | 0 0
  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          oscam
  4. # Required-Start:    $remote_fs $syslog
  5. # Required-Stop:     $remote_fs $syslog
  6. # Default-Start:     2 3 4 5
  7. # Default-Stop:      0 1 6
  8. # Short-Description: Oscam init script
  9. # Description:       Launch oscam at startup
  10. ### END INIT INFO
  11.  
  12. DAEMON=/usr/local/bin/oscam
  13. OSCAM_CONFIG_DIR="/var/opt/oscam"
  14. OSCAM_TMP_DIR="/tmp/oscam/"
  15. DAEMON_OPTS="-b -r 2 -t ${OSCAM_TMP_DIR} -c ${OSCAM_CONFIG_DIR}"
  16. DAEMON_USER="oscam"
  17. PIDFILE=/run/oscam.pid
  18.  
  19. test -x ${DAEMON} || exit 0
  20.  
  21. # Make OSCAM_TMP_DIR writable
  22. mkdir -p $OSCAM_TMP_DIR
  23. chown $DAEMON_USER:$DAEMON_USER $OSCAM_TMP_DIR
  24.  
  25. . /lib/lsb/init-functions
  26.  
  27. case "$1" in
  28.     start)
  29. # Enable Phoenix mode on the reader before starting Oscam
  30. log_daemon_msg "Enabling Phoenix mode"
  31. /usr/bin/nftytool -p phoenix -- -p phoenix -f 3.58 -e > /dev/null 2>&1
  32. log_daemon_msg "Starting OScam"
  33. start-stop-daemon --start --quiet --chuid $DAEMON_USER --user $DAEMON_USER --background --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} -- ${DAEMON_OPTS}
  34. log_end_msg $?
  35.     ;;
  36.     stop)
  37. log_daemon_msg "Stopping OScam"
  38. start-stop-daemon --stop --exec ${DAEMON}
  39. log_end_msg $?
  40.     ;;
  41.     force-reload|restart)
  42.     $0 stop
  43.     $0 start
  44.     ;;
  45.   *)
  46.     echo "Usage: /etc/init.d/oscam {start|stop|restart|force-reload}"
  47.     exit 1
  48.     ;;
  49. esac
  50.  
  51. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement