Contents of /trunk/virtualbox/virtualbox-wrapper.sh
Parent Directory | Revision Log
Revision 126 -
(show annotations)
(download)
(as text)
Fri Apr 13 21:55:56 2007 UTC (17 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 1235 byte(s)
Fri Apr 13 21:55:56 2007 UTC (17 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 1235 byte(s)
- wrapper and config tool for virtualbox
1 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/virtualbox/virtualbox-wrapper.sh,v 1.1 2007-04-13 21:55:56 niro Exp $ |
3 | # Wrapper for virtual for Magellan-Linux |
4 | |
5 | LIBDIR=/usr/lib |
6 | INSTDIR=${LIBDIR}/virtualbox |
7 | XPCOM_DAEMON=VBoxSVC |
8 | VBOXCONFIG=$HOME/.VirtualBox |
9 | VBOXLOG=${VBOXCONFIG}/log |
10 | |
11 | |
12 | |
13 | # check for the vbox module |
14 | if [[ ! -w /dev/vboxdrv ]] |
15 | then |
16 | echo "Please make sure that you have the virtualbox kernel module installed and loaded." |
17 | echo "Run 'virtualbox-config' to get the kernel module compiled and installed." |
18 | fi |
19 | |
20 | # set lib dir |
21 | export LD_LIBRARY_PATH="${INSTDIR}" |
22 | |
23 | # check for the vbox XPCOM daemon |
24 | pid=$( ps -U $USER | grep ${XPCOM_DAEMON} | awk '{ print $1 }' ) |
25 | |
26 | # kill all running instances for $USER |
27 | if [[ -n ${pid} ]] |
28 | then |
29 | kill -TERM ${pid} |
30 | sleep 2 |
31 | |
32 | # kill the pidfile |
33 | rm -rf /tmp/.vbox-$USER-ipc |
34 | fi |
35 | |
36 | # start the daemon |
37 | install -d ${VBOXCONFIG} |
38 | ${INSTDIR}/${XPCOM_DAEMON} --daemonize > ${VBOXLOG} 2>&1 |
39 | |
40 | # start the proper application |
41 | case $(basename $0) in |
42 | virtualbox) |
43 | exec ${INSTDIR}/VirtualBox $* |
44 | ;; |
45 | vboxmanage) |
46 | exec ${INSTDIR}/VBoxManage $* |
47 | ;; |
48 | vboxsdl) |
49 | exec ${INSTDIR}/VBoxSDL $* |
50 | ;; |
51 | vboxbfe) |
52 | exec ${INSTDIR}/VBoxBFE $* |
53 | ;; |
54 | *) |
55 | echo "Error: Unknown application - $(basename $0)" |
56 | exit 1 |
57 | ;; |
58 | esac |