2011-01-05 20:32:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
# Make sure we have a terminal for the user to see and then run
|
|
|
|
|
# the real install script.
|
|
|
|
|
|
2011-02-02 22:01:24 +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.
|
|
|
|
|
|
2011-02-08 22:23:44 +00:00
|
|
|
SAVED_PWD=$PWD
|
2011-05-27 19:46:51 +00:00
|
|
|
PKG_PATH=$(dirname "$(readlink -f "$0")")
|
|
|
|
|
cd "${PKG_PATH}"
|
2011-02-02 22:01:24 +00:00
|
|
|
|
2011-11-08 17:55:49 +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-02-09 16:24:20 +00:00
|
|
|
if which xterm > /dev/null; then
|
2011-05-27 19:46:51 +00:00
|
|
|
exec xterm -e "${PKG_PATH}/.stage2.run"
|
2011-02-09 16:24:20 +00:00
|
|
|
elif which gnome-terminal > /dev/null; then
|
2011-05-27 19:46:51 +00:00
|
|
|
exec gnome-terminal -e "${PKG_PATH}/.stage2.run"
|
2011-01-06 22:11:04 +00:00
|
|
|
elif which konsole > /dev/null; then
|
2011-05-27 19:46:51 +00:00
|
|
|
exec konsole -e "${PKG_PATH}/.stage2.run"
|
2011-01-06 22:11:04 +00:00
|
|
|
fi
|
2011-01-05 20:32:14 +00:00
|
|
|
else
|
2011-05-27 19:46:51 +00:00
|
|
|
"${PKG_PATH}/.stage2.run"
|
2011-01-05 20:32:14 +00:00
|
|
|
fi
|
2011-02-02 22:01:24 +00:00
|
|
|
|
2011-05-27 19:46:51 +00:00
|
|
|
cd "${SAVED_PWD}"
|