This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_install_tools.sh
77 lines (59 loc) · 1.44 KB
/
1_install_tools.sh
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
#! /bin/bash
SCRIPT=`basename $0`
ERROR=1
SUCCESS=0
APT_PARMS="-qq"
SEPERATOR="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
BUILD_TOOLS="wget curl build-essential clang bison openssl zlib1g libxslt1.1 libxml2-dev libffi-dev libyaml-dev libxslt-dev libssl-dev autoconf libc6-dev libreadline6 libreadline6-dev zlib1g-dev libcurl4-openssl-dev ncurses-dev automake"
DB_TOOLS="libsqlite3-0 sqlite3 libsqlite3-dev postgresql postgresql-client libpq-dev"
IMAGE_TOOLS="imagemagick libmagick9-dev"
SOURCEMGMT_TOOLS="git-core"
TESTING_TOOLS="libnotify-bin"
usage()
{
echo "$SCRIPT: usage: -h || <no args>"
}
install_tools()
{
apt-get install $1 $APT_PARMS
RETURN=$?
return $RETURN
}
if [ `id -u` -ne 0 ]
then
echo "$SCRIPT: ERROR: Script needs to be run as root or with sudo."
exit $ERROR
fi
while getopts ":h :s:" opt; do
case $opt in
h)
usage
exit $SUCCESS
;;
\?)
echo "$SCRIPT: Invalid option: -$OPTARG" >&2
usage
exit $ERROR
;;
:)
echo "$SCRIPT: Option -$OPTARG requires an argument." >&2
usage
exit $ERROR
;;
esac
done
echo "Installing tools ..."
for TOOL in $BUILD_TOOLS $DB_TOOLS $IMAGE_TOOLS $SOURCEMGMT_TOOLS $TESTING_TOOLS
do
echo $SEPERATOR
echo "$SCRIPT: Installing $TOOL."
install_tools $TOOL
if [ $? -eq $SUCCESS ]
then
echo "$SCRIPT: $TOOL installed and configured successfully."
else
echo "$SCRIPT: ERROR: $TOOL failed to install." >&2
fi
echo $SEPERATOR
done
exit $SUCCESS