2011-01-31 09:48:34 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Make sure we have a terminal for the user to see and then run
|
|
|
|
# the real install script.
|
|
|
|
|
2011-02-25 17:05:15 -05: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 15:46:28 -04:00
|
|
|
PKG_PATH=$(dirname "$(readlink -f "$0")")
|
|
|
|
cd "${PKG_PATH}"
|
2011-02-25 17:05:15 -05:00
|
|
|
|
2011-11-08 13:07:29 -05: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 09:48:34 -05:00
|
|
|
if which xterm > /dev/null; then
|
2016-08-12 07:36:04 -04:00
|
|
|
exec xterm -e "${PKG_PATH}/.stage2.run $@"
|
2011-01-31 09:48:34 -05:00
|
|
|
elif which gnome-terminal > /dev/null; then
|
2016-08-12 07:36:04 -04:00
|
|
|
exec gnome-terminal -e "${PKG_PATH}/.stage2.run $@"
|
2011-01-31 09:48:34 -05:00
|
|
|
elif which konsole > /dev/null; then
|
2016-08-12 07:36:04 -04:00
|
|
|
exec konsole -e "${PKG_PATH}/.stage2.run $@"
|
2011-01-31 09:48:34 -05:00
|
|
|
fi
|
|
|
|
else
|
2016-08-12 07:36:04 -04:00
|
|
|
"${PKG_PATH}/.stage2.run" "$@"
|
2011-01-31 09:48:34 -05:00
|
|
|
fi
|
2011-02-25 17:05:15 -05:00
|
|
|
|
2011-05-27 15:46:28 -04:00
|
|
|
cd "${SAVED_PWD}"
|