#!/bin/sh # # chkconfig: 345 91 35 # description: Starts and stops vncserver. \ # used to provide remote X administration services. # Source function library. . /etc/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 start() { echo -n "Starting VNC server: " daemon vncserver RETVAL=$? echo [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vncserver } stop() { echo -n "Shutting down VNC server: " killproc vncserver RETVAL=$? echo [ "$RETVAL" -eq 0 ] && rm -f /var/lock/subsys/vncserver } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; condrestart) if [ -f /var/lock/subsys/vncserver ]; then stop start fi ;; status) status vncserver ;; *) echo "Usage: vncserver {start|stop|restart|condrestart|status}" exit 1 esac