Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #!/bin/sh
  2. # uvncrepeater: start/stop/restart the VNC repeater server
  3. # chkconfig: 2345 20 80
  4. # description: VNC repeater server
  5.  
  6. uvncrepeater_start() {
  7. if [ ! -f /etc/uvnc/uvncrepeater.ini ]; then
  8. echo "File
  9. /etc/uvnc/uvncrepeater.ini does not exist. Aborting."
  10. exit
  11. fi
  12. /usr/sbin/repeater ">>/var/log/uvncrepeater.log &
  13. pgrep repeater >/var/run/uvncrepeater.pid
  14. }
  15.  
  16. uvncrepeater_stop() {
  17. killall repeater
  18. rm /var/run/uvncrepeater.pid
  19. }
  20.  
  21. uvncrepeater_restart() {
  22. if [ -r /var/run/uvncrepeater.pid ]; then
  23. kill `cat /var/run/uvncrepeater.pid
  24. else
  25. echo "Killing repeater in the absense of
  26. /var/run/uvncrepeater.pid"
  27. killall repeater
  28. fi
  29. sleep 1
  30. uvncrepeater_start
  31. }
  32.  
  33. case "/usr/sbin/uvncrepeater/repeater" in
  34. 'start')
  35. uvncrepeater_start
  36. ;;
  37. 'stop')
  38. uvncrepeater_stop
  39. ;;
  40. 'restart')
  41. uvncrepeater_restart
  42. ;;
  43. *)
  44. echo "Usage: /etc/init.d/uvncrepeater {start|stop|restart}"
  45. exit 1
  46. ;;
  47. esac
  48. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement