Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- ### BEGIN INIT INFO
- # Provides: oscam
- # Required-Start: $remote_fs $syslog
- # Required-Stop: $remote_fs $syslog
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Oscam init script
- # Description: Launch oscam at startup
- ### END INIT INFO
- DAEMON=/usr/local/bin/oscam
- OSCAM_CONFIG_DIR="/var/opt/oscam"
- OSCAM_TMP_DIR="/tmp/oscam/"
- DAEMON_OPTS="-b -r 2 -t ${OSCAM_TMP_DIR} -c ${OSCAM_CONFIG_DIR}"
- DAEMON_USER="oscam"
- PIDFILE=/run/oscam.pid
- test -x ${DAEMON} || exit 0
- # Make OSCAM_TMP_DIR writable
- mkdir -p $OSCAM_TMP_DIR
- chown $DAEMON_USER:$DAEMON_USER $OSCAM_TMP_DIR
- . /lib/lsb/init-functions
- case "$1" in
- start)
- # Enable Phoenix mode on the reader before starting Oscam
- log_daemon_msg "Enabling Phoenix mode"
- /usr/bin/nftytool -p phoenix -- -p phoenix -f 3.58 -e > /dev/null 2>&1
- log_daemon_msg "Starting OScam"
- start-stop-daemon --start --quiet --chuid $DAEMON_USER --user $DAEMON_USER --background --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} -- ${DAEMON_OPTS}
- log_end_msg $?
- ;;
- stop)
- log_daemon_msg "Stopping OScam"
- start-stop-daemon --stop --exec ${DAEMON}
- log_end_msg $?
- ;;
- force-reload|restart)
- $0 stop
- $0 start
- ;;
- *)
- echo "Usage: /etc/init.d/oscam {start|stop|restart|force-reload}"
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement