2011-01-31 14:48:34 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
# Make sure we have a terminal for the user to see and then run
|
|
|
|
|
# the real install script.
|
|
|
|
|
|
2011-02-25 22:05:15 +00:00
|
|
|
# Some systems don't correctly set the PWD when a script is double-clicked,
|
|
|
|
|
# so go ahead and figure out our path and make sure we are in that directory.
|
|
|
|
|
|
|
|
|
|
SAVED_PWD=$PWD
|
2011-05-27 19:46:28 +00:00
|
|
|
PKG_PATH=$(dirname "$(readlink -f "$0")")
|
|
|
|
|
cd "${PKG_PATH}"
|
2011-02-25 22:05:15 +00:00
|
|
|
|
2011-11-08 18:07:29 +00:00
|
|
|
# check for an interactive terminal
|
|
|
|
|
# -t fd - Returns true if file descriptor fd is open and refers to a terminal.
|
|
|
|
|
# fd 1 is stdout
|
|
|
|
|
if [ ! -t 1 ]; then
|
2011-01-31 14:48:34 +00:00
|
|
|
if which xterm > /dev/null; then
|
2016-08-12 13:36:04 +02:00
|
|
|
exec xterm -e "${PKG_PATH}/.stage2.run $@"
|
2011-01-31 14:48:34 +00:00
|
|
|
elif which gnome-terminal > /dev/null; then
|
2016-08-12 13:36:04 +02:00
|
|
|
exec gnome-terminal -e "${PKG_PATH}/.stage2.run $@"
|
2011-01-31 14:48:34 +00:00
|
|
|
elif which konsole > /dev/null; then
|
2016-08-12 13:36:04 +02:00
|
|
|
exec konsole -e "${PKG_PATH}/.stage2.run $@"
|
2011-01-31 14:48:34 +00:00
|
|
|
fi
|
|
|
|
|
else
|
2016-08-12 13:36:04 +02:00
|
|
|
"${PKG_PATH}/.stage2.run" "$@"
|
2011-01-31 14:48:34 +00:00
|
|
|
fi
|
2011-02-25 22:05:15 +00:00
|
|
|
|
2011-05-27 19:46:28 +00:00
|
|
|
cd "${SAVED_PWD}"
|