Advertisement
gpulover

/etc/init.d/vncserver

Apr 9th, 2018
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #!/bin/bash
  2. PATH="$PATH:/usr/bin/"
  3. export USER="CHANGE____"
  4. DISPLAY="1"
  5. DEPTH="16"
  6. GEOMETRY="1440x900"
  7. OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}" #-localhost"
  8. . /lib/lsb/init-functions
  9.  
  10. case "$1" in
  11. start)
  12. log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
  13. su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
  14. ;;
  15.  
  16. stop)
  17. log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}"
  18. su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
  19. ;;
  20.  
  21. restart)
  22. $0 stop
  23. $0 start
  24. ;;
  25. esac
  26. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement