From: Heiko Z. <smi...@us...> - 2006-06-08 15:38:45
|
Update of /cvsroot/devil-linux/build/scripts/scripts In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8889/scripts/scripts Added Files: Tag: rel-1-2-patches vmware Log Message: added support to act as VMWare Guest OS (vmware daemon, vmmemctl & vmxnet) --- NEW FILE: vmware --- #!/bin/bash # VTUN added by Diego Torres <dt...@co...> ### BEGIN INIT INFO # Provides: vmware # Required-Start: $syslog # Required-Stop: $syslog # Default-Start: 3 5 # Default-Stop: 0 1 6 # Description: starts the vmware support ### END INIT INFO # settings source /etc/sysconfig/config GUESTD_PID_FILE='/var/run/vmware-guestd.pid' # parameters NAME="VMWare Guest OS daemon" CONFIGNAME=VMWARE DAEMON=/usr/sbin/vmware-guestd PARAMETER="--background $GUESTD_PID_FILE" # source function library source /etc/init.d/functions eval START=\$START_$CONFIGNAME # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START=yes test "$START" = "yes" || exit 0 if [ ! /usr/sbin/vmware-checkvm &> /dev/null ]; then # Not running inside a Virtual Machine or vmware tools not found exit 0 fi case "$1" in start) echo "VMWare Virtual Machine detected" echo "Loading VMWare modules" modprobe vmmemctl modprobe vmxnet echo -n "Starting $NAME: " loadproc $DAEMON $PARAMETER ;; stop) echo -n "Shutting down $NAME: " killproc $DAEMON echo "Loading VMWare modules" rmmod vmmemctl rmmod vmxnet ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac |