vboxadd-service.sh revision e55f22765a01948072d6fa720ac5e1b3cdbad436
#
# Linux Additions Guest Additions service daemon init script.
#
# Copyright (C) 2006-2010 Oracle Corporation
#
# 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.
#
# chkconfig: 35 35 65
# description: VirtualBox Additions service
#
### BEGIN INIT INFO
# Provides: vboxadd-service
# Required-Start: vboxadd
# Required-Stop: vboxadd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: VirtualBox Additions Service
### END INIT INFO
if [ -f /etc/redhat-release ]; then
elif [ -f /etc/SuSE-release ]; then
elif [ -f /etc/debian_version ]; then
elif [ -f /etc/gentoo-release ]; then
elif [ -f /etc/arch-release ]; then
elif [ -f /etc/slackware-version ]; then
elif [ -f /etc/lfs-release ]; then
else
fi
fi
if [ "$system" = "redhat" ]; then
echo
}
echo
}
echo -n "$1"
}
fi
if [ "$system" = "suse" ]; then
}
rc_status -v
}
rc_status -v
}
echo -n "$1"
}
fi
if [ "$system" = "debian" ]; then
}
}
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
if [ "$system" = "gentoo" ]; then
. /sbin/functions.sh
}
}
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
shift
fi
fi
if [ "$system" = "arch" ]; then
$@
test $? -eq 0 && add_daemon rc.`basename $1`
}
killall $@
}
}
}
stat_busy "$1"
}
fi
if [ "$system" = "slackware" ]; then
$1 $2
}
killall $1
}
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
if [ "$system" = "lfs" ]; then
loadproc $1 $2
}
}
}
echo $1
}
statusproc $1
}
fi
if [ "$system" = "other" ]; then
echo " ...fail!"
}
echo " ...done."
}
echo -n "$1"
}
fi
echo "Cannot run $binary"
exit 1
}
}
}
if ! test -f $PIDFILE; then
vboxaddrunning || {
echo "VirtualBox Additions module not loaded!"
exit 1
}
RETVAL=$?
fi
return $RETVAL
}
stop() {
if test -f $PIDFILE; then
RETVAL=$?
if ! pidof VBoxService > /dev/null 2>&1; then
else
fi
fi
return $RETVAL
}
stop && start
}
echo -n "Checking for VBoxService"
if [ -f $PIDFILE ]; then
echo " ...running"
else
echo " ...not running"
fi
}
case "$1" in
;;
stop)
stop
;;
;;
;;
;;
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL