routines.sh revision 346c5a85beb75755df96ed06b23c6613495cede0
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# Oracle VM VirtualBox
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# VirtualBox installer shell routines
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# Copyright (C) 2007-2011 Oracle Corporation
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# This file is part of VirtualBox Open Source Edition (OSE), as
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# available from http://www.virtualbox.org. This file is free software;
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# you can redistribute it and/or modify it under the terms of the GNU
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# General Public License (GPL) as published by the Free Software
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# Foundation, in version 2 as it comes in the "COPYING" file of the
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# Aborts the script and prints an error message to stderr.
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# syntax: abort message
15f60c5ba586de69e94c6045e9bf91103e924020James Phillpotts# Creates an empty log file and remembers the name for future logging
15f60c5ba586de69e94c6045e9bf91103e924020James Phillpotts# syntax: create_log logfile
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste abort "create_log called without an argument! Aborting..."
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste if [ ! -f "$ro_LOG_FILE" -o "`cat "$ro_LOG_FILE"`" != "" ]; then
95ac3084c619fd042f83410e5436ec3f1c3da190Brian Bailey# Writes text to standard error
95ac3084c619fd042f83410e5436ec3f1c3da190Brian Bailey# Syntax: info text
c423fd5d4f121413c5e72c134412b6ce5daa0dd9Jaco Jooste# Writes text to the log file
c423fd5d4f121413c5e72c134412b6ce5daa0dd9Jaco Jooste# Syntax: log text
c423fd5d4f121413c5e72c134412b6ce5daa0dd9Jaco Jooste abort "Error! Logging has not been set up yet! Aborting..."
7cbae22b7560eefcf086863923459880aa87f014Jaco Jooste# Writes test to standard output and to the log file
if [ -f /etc/init.d/vboxweb-service ]; then
kill -USR1 $VBOXSVC_PID
sleep 1
if [ ! -d $ro_KBUILD_DIR/include ]; then
if [ ! -d $ro_KBUILD_DIR/include ]; then
elif [ -f /etc/debian_version ]; then
elif [ -f /etc/gentoo-release ]; then
elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then
elif [ -f /etc/pardus-release ]; then
script=$1
name=$2
test $? -ne 1 || return 1
name=$1
test $? -ne 1 || return 1
name=$1
test $? -ne 1 || return 1
name=$1
test $? -ne 1 || return 1
update-rc.d -f $1 remove > /dev/null 2>&1
update-rc.d $1 defaults $2 $3 > /dev/null 2>&1
P2=$2
P3=$3
if ! grep -q $1 $ro_RC_LOCAL
update-rc.d -f $1 remove > /dev/null 2>&1
name=$1
test $? -ne 1 || return 1
name=$1
test $? -ne 1 || return 1
PROC_NAME=$1
killall -TERM $PROC_NAME > /dev/null 2>&1
sleep 2
export VBOX_INSTALL_PATH