Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # uvncrepeater: start/stop/restart the VNC repeater server
- # chkconfig: 2345 20 80
- # description: VNC repeater server
- uvncrepeater_start() {
- if [ ! -f /etc/uvnc/uvncrepeater.ini ]; then
- echo "File
- /etc/uvnc/uvncrepeater.ini does not exist. Aborting."
- exit
- fi
- /usr/sbin/repeater ">>/var/log/uvncrepeater.log &
- pgrep repeater >/var/run/uvncrepeater.pid
- }
- uvncrepeater_stop() {
- killall repeater
- rm /var/run/uvncrepeater.pid
- }
- uvncrepeater_restart() {
- if [ -r /var/run/uvncrepeater.pid ]; then
- kill `cat /var/run/uvncrepeater.pid
- else
- echo "Killing repeater in the absense of
- /var/run/uvncrepeater.pid"
- killall repeater
- fi
- sleep 1
- uvncrepeater_start
- }
- case "/usr/sbin/uvncrepeater/repeater" in
- 'start')
- uvncrepeater_start
- ;;
- 'stop')
- uvncrepeater_stop
- ;;
- 'restart')
- uvncrepeater_restart
- ;;
- *)
- echo "Usage: /etc/init.d/uvncrepeater {start|stop|restart}"
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement