Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # novnc Script to start and stop the novnc html5 "proxy" to share your vnc connection
- #
- # chkconfig: 345 65 35
- # description:
- # processname: wsproxy.py
- # config: /etc/sysconfig/novnc
- # Source function library.
- . /etc/rc.d/init.d/functions
- . /etc/sysconfig/novnc
- exec="/var/hda/web-apps/vnc/html/utils/wsproxy.py"
- prog=$(basename $exec)
- lockfile=/var/lock/subsys/$prog
- start() {
- if [ -f $lockfile ]; then
- return 0
- fi
- echo -n $"Starting $prog: "
- ${exec} --web $WEB ${CERT:+--cert $CERT} $PORT $VNC_DEST > /dev/null 2> /dev/null &
- retval=$?
- echo
- [ $retval -eq 0 ] && touch $lockfile
- return $retval
- }
- stop() {
- echo -n $"Stopping $prog: "
- processpid=$(ps -ef | grep python | grep wsproxy.py | awk '{ print $2 }')
- kill -9 ${processpid}
- retval=$?
- echo
- [ $retval -eq 0 ] && rm -f $lockfile
- return $retval
- }
- restart() {
- stop
- start
- }
- reload() {
- restart
- }
- force_reload() {
- restart
- }
- fdrstatus() {
- status $prog
- }
- # See how we were called.
- case "$1" in
- start|stop|restart|reload)
- $1
- ;;
- force-reload)
- force_reload
- ;;
- status)
- fdrstatus
- ;;
- condrestart)
- [ ! -f $lockfile ] || restart
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
- exit 2
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement