/
configure
executable file
·83 lines (66 loc) · 2.06 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
THISSCRIPT="configure"
# Copyright (c) 2009 Ryan Pavlik <ryan.pavlik@snc.edu>
# See COPYING.txt for license terms
# First-run configuration.
DATESTAMPORIG="$(date +%Y%m%d.%H.%M.%S)"
LOC=$0
MYFULLPATH="$(readlink -f -n $LOC)"
MYENCLOSINGDIR="$(dirname $MYFULLPATH)"
echo
echo "----Configuring (running $MYFULLPATH/scripts/1_mt_scripts_configuration.sh)..."
pushd . >/dev/null
cd $MYENCLOSINGDIR/scripts
chmod +x *.sh
./1_mt_scripts_configuration.sh
RV=$?
if [ $RV -ne 0 ]; then
echo "-----There seems to have been an error. Please resolve any problems indicated and try again."
exit 1
fi
echo "-----Configuration apparently successful. Setting up next stage."
cd $MYENCLOSINGDIR
source scripts/z_globals.inc
log_append "this script was actually started at $DATESTAMPORIG"
log_append_dated "Now building 'install' script"
cat > install.sh <<heredoc
#!/bin/bash
# installer built $DATESTAMPORIG by $THISSCRIPT
# Auto-generated install chain file for Ryan Pavlik's
# multi-touch scripts
heredoc
cat > install.sh <<"heredoc"
THISSCRIPT="install.sh"
source scripts/z_globals.inc
pushd . > /dev/null
cd $MTROOT/scripts
./1_install_all_default.sh
RV=$?
cd ..
if [ $RV -eq 0 ]; then
chmod -x $THISSCRIPT
touch "$THISSCRIPT.ran-$DATESTAMP.log"
fi
heredoc
chmod +x install.sh
touch "$THISSCRIPT.completed-$DATESTAMPORIG.log"
log_append "created install.sh as executable to chainload 1_install_all_default.sh"
popd >/dev/null
echo "-----Install stage generation complete!"
echo "If you ever move the location of this directory tree,"
echo "please run scripts/1_mt_scripts_configure.sh in the new location"
echo "to update the configuration."
echo
echo "Next step: run ./install.sh for a default install"
echo "or run individual install scripts in scripts/ as desired."
echo
echo "Press enter or wait 10 seconds to return to command line, or"
echo "type 'install', no quotes, and hit enter to start a default install"
read -t 10 answer
if [ "$answer" = 'install' ]; then
echo "Starting a default install..."
echo "-----------------------------"
cd $MYENCLOSINGDIR
./install.sh
fi
echo