-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·56 lines (46 loc) · 1003 Bytes
/
install
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
#!/bin/bash
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~#
# Installs the ingestion utilities in the system onto the given directory.
#
# USAGE: $0 TARGET_DIR
# @author: pcampalani
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~#
USAGE="$0 TARGET_DIR"
ME="$( basename $0 )"
scripts="
manage_datasets
ingest_shp
unpublish_shp
fetch_ftype utils
"
conn_files="
pg_conn.default
gs_conn.default
"
n_args=1
# exit codes:
CODE_OK=0
CODE_WRONG_USAGE=1
# echo formatting
bold=`tput bold`
normal=`tput sgr0`
alias log='echo ${bold}[$ME]${normal} '
alias logn='echo -n ${bold}[$ME]${normal} '
shopt -s expand_aliases
# check args
if [ $# -ne $n_args ]; then
echo USAGE: "$USAGE"
exit $CODE_WRONG_USAGE
fi
target_dir="$1"
if [ ! -d "$target_dir" ]; then
mkdir "$target_dir"
fi
# install
log "Installing scripts to \"$target_dir\"... "
cp -v $scripts $target_dir
cp -iv $conn_files $target_dir
log "Done."
log "Bye..."
unalias log
exit $CODE_OK