~ubuntu-branches/ubuntu/utopic/ardour3/utopic

« back to all changes in this revision

Viewing changes to tools/linux_packaging/install.sh

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler
  • Date: 2013-09-21 19:05:02 UTC
  • Revision ID: package-import@ubuntu.com-20130921190502-8gsftrku6jnzhd7v
Tags: upstream-3.4~dfsg
ImportĀ upstreamĀ versionĀ 3.4~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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}"