Script Pornire OSCam pentru Ubuntu si alte versiuni de linux
Creeaza un fisier pe care sa il numesti oscam respectand calea aceasta: /etc/init.d/oscam . Dupa ce l-ai creat introdu urmatorul script in el:
#!/bin/shDAEMON=/usr/local/bin/oscamPIDFILE=/var/run/oscam.pidDAEMON_OPTS=„-p 1024 -w 5 -r 2 -B ${PIDFILE}”test –x ${DAEMON} || exit 0. /lib/lsb/init–functionscase „$1” instart)log_daemon_msg „Starting OScam…”/sbin/start–stop–daemon –start –quiet –background –exec ${DAEMON} – ${DAEMON_OPTS}log_end_msg $?;;stop)log_daemon_msg „Stopping OScam…”/sbin/start–stop–daemon –stop –exec ${DAEMON}log_end_msg $?;;restart)$0 stop$0 start;;force–reload)$0 stop/bin/kill –9 `pidof oscam`/usr/bin/killall –9 oscam$0 start;;*)echo „Usage: /etc/init.d/oscam {start|stop|restart|force-reload}”exit 1;;esac
This assumes that you have the oscam binary located in /usr/local/bin/oscam. Remember you have to create this file as the root user.
To “enable” the script and the starting up of oscam on reboot, use the following commands on Ubuntu/Debian:
sudo chmod +x /etc/init.d/oscamsudo update–rc.d oscam defaults
#!/bin/bashPIDFILE=/var/run/oscam.pidif (kill –0 `cat $PIDFILE`)thenecho „it’s alive!” > /dev/nullelserm $PIDFILE/etc/init.d/oscam start > /dev/nullecho „OSCAM restarted at `date`” >> /var/log/oscam–crash.logfi
sudo chmod +x /usr/local/bin/oscamchksudo crontab –e
* * * * * /usr/local/bin/oscamchk >/dev/null 2>&1