annotate packaging/linux-installer.inc.in @ 705:ff2efc1cb8fa

Use config from old installation for sensible default prefix.
author Sascha Wilde <wilde@intevation.de>
date Wed, 02 Jul 2014 11:56:56 +0200
parents 480bc550d2ad
children 37899f717fa5
rev   line source
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
1 #!/bin/bash
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
2
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
3 ME=`basename "$0"`
704
480bc550d2ad Better default prefix for local installation.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
4 DEFAULT_PREFIX="$HOME/TrustBridge"
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
5 CFGPATH="${XDG_DATA_HOME:-$HOME/.local/share}/BSI/TrustBridge"
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
6 SYSCFGPATH="/etc/TrustBridge"
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
7 INSTCFGNAME="installation.cfg"
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
8 FORCE=0
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
9
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
10 instcfg_file="${CFGPATH}/${INSTCFGNAME}"
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
11 declare -A instcfg oldinstcfg
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
12 instcfg=(
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
13 [TIMESTMP]=`date -u +%Y%m%d%H%M%S`
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
14 [VERSION]='@PROJECT_VERSION@'
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
15 [PREFIX]=''
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
16 )
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
17 oldinstcfg=(
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
18 [TIMESTMP]=''
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
19 [VERSION]=''
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
20 [PREFIX]=''
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
21 )
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
22
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
23 version()
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
24 {
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
25 cat <<EOF
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
26 TrustBridge ${instcfg[VERSION]} Installer
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
27
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
28 Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
29 Software engineering by Intevation GmbH
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
30
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
31 This is free software. You may redistribute copies of it under the terms of
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
32 the GNU GPL (v>=2). See LICENSE.txt for details.
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
33 There is NO WARRANTY, to the extent permitted by law.
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
34 EOF
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
35 exit 0
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
36 }
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
37
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
38 fatal()
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
39 {
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
40 echo "$1" >&2
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
41 echo "Installation failed." >&2
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
42 exit 1
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
43 }
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
44
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
45 usage()
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
46 {
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
47 cat <<EOF
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
48 Usage: $ME [OPTION]...
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
49 Install TrustBridge.
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
50
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
51 Options:
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
52 -p, --prefix=PATH install files in PATH
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
53 -f, --force install to given prefix, even when a current
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
54 installation with different prefix exists.
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
55 --help display this help and exit
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
56 --version output version information and exit
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
57 EOF
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
58 exit $1
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
59 }
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
60
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
61 parse_args()
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
62 {
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
63 OPTS=`getopt \
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
64 -l force,help,prefix:,version \
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
65 -o f,p: -n "$ME" -- "$@"`
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
66 [ $? -eq 0 ] || usage 23
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
67
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
68 eval set -- "$OPTS"
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
69
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
70 while true ; do
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
71 case "$1" in
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
72 --prefix|-p)
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
73 instcfg[PREFIX]="$2"
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
74 shift 2
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
75 ;;
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
76 --force|-f)
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
77 FORCE=1
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
78 shift 1
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
79 ;;
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
80 --help)
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
81 usage 0
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
82 ;;
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
83 --version)
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
84 version
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
85 ;;
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
86 --)
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
87 shift
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
88 break
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
89 ;;
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
90 esac
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
91 done
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
92 }
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
93
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
94 write_instcfg()
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
95 {
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
96 install -d `dirname "$instcfg_file"`
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
97 echo "# Created by TrustBridge-Installer, don't touch!" >"$instcfg_file"
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
98 for key in "${!instcfg[@]}" ; do
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
99 echo "${key}=${instcfg[$key]}" >>"$instcfg_file"
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
100 done
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
101 }
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
102
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
103 read_oldinstcfg()
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
104 {
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
105 if [ -r "$instcfg_file" ] ; then
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
106 echo "Reading '$instcfg_file' ..."
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
107 for key in "${!oldinstcfg[@]}" ; do
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
108 oldinstcfg[$key]=`sed -n "/$key/s/[^=]*=\(.*\)/\1/p" "$instcfg_file"`
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
109 done
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
110 fi
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
111 }
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
112
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
113 #======================================================================
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
114 # main()
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
115
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
116 parse_args "$@"
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
117 read_oldinstcfg
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
118
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
119 cat <<EOF
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
120 ------------------------------------------------------------------------
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
121
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
122 TrustBridge - Installer
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
123 Version ${instcfg[VERSION]}
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
124
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
125 ------------------------------------------------------------------------
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
126 EOF
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
127
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
128 if [ -z "${instcfg[PREFIX]}" ] ; then
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
129
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
130 if [ "${oldinstcfg[PREFIX]}" ] ; then
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
131 DEFAULT_PREFIX="${oldinstcfg[PREFIX]}"
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
132 echo "An existing installation (v${oldinstcfg[VERSION]}) was detected!"
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
133 echo "It is HIGHLY RECOMMENDED to accept the default prefix"
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
134 echo "to update the current installation."
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
135 echo "For a new prefix you should deinstall first!"
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
136 fi
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
137 echo -n "Select installation prefix for TrustBridge [${DEFAULT_PREFIX}]: "
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
138 read -e instcfg[PREFIX]
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
139
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
140 [ -z "${instcfg[PREFIX]}" ] && instcfg[PREFIX]="${DEFAULT_PREFIX}"
705
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
141 else
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
142 # Prefix was given on invocation:
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
143 if [ "${oldinstcfg[PREFIX]}" -a \
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
144 "${instcfg[PREFIX]}" != "${oldinstcfg[PREFIX]}" -a \
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
145 $FORCE -ne 1 ] ; then
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
146 fatal "Prefix differs from current installation (${oldinstcfg[PREFIX]}). Aborting!"
ff2efc1cb8fa Use config from old installation for sensible default prefix.
Sascha Wilde <wilde@intevation.de>
parents: 704
diff changeset
147 fi
698
b55d49150e36 Added command line args for unattended installation.
Sascha Wilde <wilde@intevation.de>
parents: 682
diff changeset
148 fi
682
578860edde53 Use default path.
Sascha Wilde <wilde@intevation.de>
parents: 680
diff changeset
149
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
150 echo "Installing to '${instcfg[PREFIX]}':"
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
151
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
152 if [ ! -d "${instcfg[PREFIX]}" ] ; then
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
153 echo "creating installation directory ..."
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
154 install -d "${instcfg[PREFIX]}" || fatal "Could not create '${instcfg[PREFIX]}'!"
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
155 fi
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
156
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
157 echo "unpacking files ..."
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
158 cd "${instcfg[PREFIX]}"
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
159
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
160 # ----------------------------------------------------------------------
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
161 # regular shar archive inserted here:
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
162 ###SHAR###
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
163 # ----------------------------------------------------------------------
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
164
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
165 echo "Writing installation configuration to: $instcfg_file ..."
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
166 write_instcfg
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 698
diff changeset
167 exit 0

http://wald.intevation.org/projects/trustbridge/