Magellan Linux

Diff of /trunk/virtualbox/virtualbox-wrapper.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 126 by niro, Fri Apr 13 21:55:56 2007 UTC revision 128 by niro, Fri Apr 13 22:52:00 2007 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # $Header: /root/magellan-cvs/src/virtualbox/virtualbox-wrapper.sh,v 1.1 2007-04-13 21:55:56 niro Exp $  # $Header: /root/magellan-cvs/src/virtualbox/virtualbox-wrapper.sh,v 1.2 2007-04-13 22:52:00 niro Exp $
3  # Wrapper for virtual for Magellan-Linux  # Wrapper for virtual for Magellan-Linux
4    
5  LIBDIR=/usr/lib  LIBDIR=/usr/lib
# Line 8  XPCOM_DAEMON=VBoxSVC Line 8  XPCOM_DAEMON=VBoxSVC
8  VBOXCONFIG=$HOME/.VirtualBox  VBOXCONFIG=$HOME/.VirtualBox
9  VBOXLOG=${VBOXCONFIG}/log  VBOXLOG=${VBOXCONFIG}/log
10    
   
   
11  # check for the vbox module  # check for the vbox module
12  if [[ ! -w /dev/vboxdrv ]]  if [[ ! -w /dev/vboxdrv ]]
13  then  then
14   echo "Please make sure that you have the virtualbox kernel module installed and loaded."   echo "Please make sure that you have the virtualbox kernel module installed and loaded."
15   echo "Run 'virtualbox-config' to get the kernel module compiled and installed."   echo "Run 'virtualbox-config' to get the kernel module compiled and installed."
16     exit 1
17  fi  fi
18    
19  # set lib dir  # set lib dir
# Line 22  export LD_LIBRARY_PATH="${INSTDIR}" Line 21  export LD_LIBRARY_PATH="${INSTDIR}"
21    
22  # check for the vbox XPCOM daemon  # check for the vbox XPCOM daemon
23  pid=$( ps -U $USER | grep ${XPCOM_DAEMON} | awk '{ print $1 }' )  pid=$( ps -U $USER | grep ${XPCOM_DAEMON} | awk '{ print $1 }' )
24    
25  # kill all running instances for $USER  # kill all running instances for $USER
26  if [[ -n ${pid} ]]  if [[ -n ${pid} ]]
27  then  then
28   kill -TERM ${pid}   kill -TERM ${pid}
29   sleep 2   sleep 2
30    
31   # kill the pidfile   # kill the pidfile
32   rm -rf /tmp/.vbox-$USER-ipc   rm -rf /tmp/.vbox-$USER-ipc
33  fi  fi

Legend:
Removed from v.126  
changed lines
  Added in v.128