X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=VirtualBox.sh;h=0babe570f4669370fe07fef1cdfc14f52362a8f5;hb=b9e884d44522d44149b211571a4d4337c5c22cdb;hp=3f45e904e5458ed1868880e7dd74b401b7f1a709;hpb=8058cd41767404d47b432260d2d64349a20bccae;p=packages%2FVirtualBox-bin.git diff --git a/VirtualBox.sh b/VirtualBox.sh index 3f45e90..0babe57 100644 --- a/VirtualBox.sh +++ b/VirtualBox.sh @@ -1,27 +1,22 @@ #!/bin/sh - BINFILE=$(basename "$0") -VBOXDIR=/usr/lib/VirtualBox -[ ! -d "$VBOXDIR" ] && VBOXDIR=/usr/lib64/VirtualBox +VBOXDIR=@LIBDIR@/VirtualBox show_message() { if [ ! -z "$DISPLAY" ] && [ -x /usr/bin/gxmessage ]; then - BAK=$IFS - IFS="" - gxmessage --center --buttons GTK_STOCK_OK -wrap -geometry 400x150 -name $BINFILE `echo -e $1` - IFS=$BAK + echo -e "$1" | gxmessage --center --buttons GTK_STOCK_OK -wrap -geometry 400x150 -name $BINFILE -file - else - echo -e $1 + echo -e "$1" fi } if [ ! -d "$VBOXDIR" ]; then - show_message "Can't find VritualBox libraries! Can't continue!.\nCorrect this situation or contact with your system administrator." + show_message "Can't find VirtualBox libraries! Can't continue!.\nCorrect this situation or contact with your system administrator." exit 1 fi if [ ! -c /dev/vboxdrv ]; then - show_message "Special character device /dev/vboxdrv doesn't exists!\nCheck your installation and if vboxdrv kernel module is loaded." + show_message "Special character device /dev/vboxdrv doesn't exists!\nCheck your installation and whether vboxdrv kernel module is loaded." exit 1 fi @@ -30,4 +25,7 @@ if [ ! -w /dev/vboxdrv ]; then exit 1 fi -LD_LIBRARY_PATH=$VBOXDIR $VBOXDIR/$BINFILE ${1:+"$@"} +[ "$BINFILE" = "VBoxVRDP" ] && BINFILE="VBoxHeadless" + +export LD_LIBRARY_PATH=$VBOXDIR +exec $VBOXDIR/$BINFILE ${1:+"$@"}