vboxguest.sh revision f4ccb18a71e0e531719734918583f84fbc72ebfe
# Sun xVM VirtualBox
# VirtualBox Guest Additions kernel module control script for Solaris.
#
# Copyright (C) 2008 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
SILENTUNLOAD=""
MODNAME="vboxguest"
VFSMODNAME="vboxvfs"
abort()
{
echo 1>&2 "## $1"
exit 1
}
info()
{
echo 1>&2 "$1"
}
{
fi
return 0
fi
}
{
loadentry=`cat /etc/name_to_major | grep $1`
else
fi
return 1
fi
return 0
}
{
return $?
}
{
return $?
}
{
abort "This program must be run with administrator privileges. Aborting"
fi
}
{
if vboxguest_loaded; then
info "VirtualBox guest kernel module already loaded."
else
if test ! vboxguest_loaded; then
abort "Failed to load VirtualBox guest kernel module."
info "VirtualBox guest kernel module loaded."
else
stop
abort "Aborting due to attach failure."
fi
fi
}
{
if vboxguest_loaded; then
info "VirtualBox guest kernel module unloaded."
info "VirtualBox guest kernel module not loaded."
fi
}
{
if vboxvfs_loaded; then
info "VirtualBox FileSystem kernel module already loaded."
else
if test ! vboxvfs_loaded; then
abort "Failed to load VirtualBox FileSystem kernel module."
else
info "VirtualBox FileSystem kernel module loaded."
fi
fi
}
{
if vboxvfs_loaded; then
/usr/sbin/modunload -i $vboxvfs_mod_id || abort "Failed to unload VirtualBox FileSystem module."
info "VirtualBox FileSystem kernel module unloaded."
fi
info "VirtualBox FileSystem kernel module not loaded."
fi
}
{
return 0
}
{
return 0
}
{
if vboxguest_loaded; then
info "Running."
else
info "Stopped."
fi
}
stop_all()
{
return 0
}
if test "$2" = "silentunload"; then
SILENTUNLOAD="$2"
fi
case "$1" in
;;
;;
;;
stop)
;;
;;
;;
;;
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0