]> git.pld-linux.org Git - packages/VirtualBox.git/blob - VirtualBox.sh
- up to 1.5.4
[packages/VirtualBox.git] / VirtualBox.sh
1 #!/bin/sh
2 BINFILE=$(basename "$0")
3 VBOXDIR=/usr/lib/VirtualBox
4 [ ! -d "$VBOXDIR" ] && VBOXDIR=/usr/lib64/VirtualBox
5
6 show_message() {
7         if [ ! -z "$DISPLAY" ] && [ -x /usr/bin/gxmessage ]; then
8                 echo -e "$1" | gxmessage --center --buttons GTK_STOCK_OK -wrap -geometry 400x150 -name $BINFILE -file -
9         else
10                 echo -e "$1"
11         fi
12 }
13
14 if [ ! -d "$VBOXDIR" ]; then
15         show_message "Can't find VritualBox libraries! Can't continue!.\nCorrect this situation or contact with your system administrator."
16         exit 1
17 fi
18
19 if [ ! -c /dev/vboxdrv ]; then
20         show_message "Special character device /dev/vboxdrv doesn't exists!\nCheck your installation and if vboxdrv kernel module is loaded."
21         exit 1
22 fi
23
24 if [ ! -w /dev/vboxdrv ]; then
25         show_message "You don't have write access to /dev/vboxdrv!\nCorrect this situation or contact with your system administrator."
26         exit 1
27 fi
28
29 export LD_LIBRARY_PATH=$VBOXDIR
30 exec $VBOXDIR/$BINFILE ${1:+"$@"}
This page took 0.028699 seconds and 3 git commands to generate.