Advertisement
gpulover

/etc/init.d/vncserver with different port

May 23rd, 2018
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.59 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. PORT="6100"
  8. OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -rfbport ${PORT}" #-localhost"
  9. . /lib/lsb/init-functions
  10.  
  11. case "$1" in
  12. start)
  13. log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
  14. su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
  15. ;;
  16.  
  17. stop)
  18. log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}"
  19. su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
  20. ;;
  21.  
  22. restart)
  23. $0 stop
  24. $0 start
  25. ;;
  26. esac
  27. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement