Add some lua scripts
[ardour.git] / tools / linux_packaging / install.sh
1 #!/bin/sh
2
3 # Make sure we have a terminal for the user to see and then run
4 # the real install script.
5
6 # Some systems don't correctly set the PWD when a script is double-clicked,
7 # so go ahead and figure out our path and make sure we are in that directory.
8
9 SAVED_PWD=$PWD
10 PKG_PATH=$(dirname "$(readlink -f "$0")")
11 cd "${PKG_PATH}"
12
13 # check for an interactive terminal
14 # -t fd - Returns true if file descriptor fd is open and refers to a terminal. 
15 # fd 1 is stdout
16 if [ ! -t 1 ]; then
17         if which xterm > /dev/null; then
18                 exec xterm -e "${PKG_PATH}/.stage2.run"
19         elif which gnome-terminal > /dev/null; then
20                 exec gnome-terminal -e "${PKG_PATH}/.stage2.run"
21         elif which konsole > /dev/null; then
22                 exec konsole -e "${PKG_PATH}/.stage2.run"
23         fi
24 else
25         "${PKG_PATH}/.stage2.run"
26 fi
27
28 cd "${SAVED_PWD}"