- Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathaenigma-clusterize
More file actions
126 lines (78 loc) · 2.89 KB
/
aenigma-clusterize
File metadata and controls
126 lines (78 loc) · 2.89 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env bash
### ############################################################################
### initialize script with standard synthia bootstrapping block.
### ############################################################################
#### 1 | add padding to output / clear screen.
echo
#### 2 | locate execution environment and perform synthia-bound operations.
#### ###########################################################################
##### set bash environment error management.
set -eu
##### determine script execution directory and install directory.
if [ -L "${BASH_SOURCE}" ]
then
###### this file is being executed via a symlink.
###### therefore identify the parent directory of the target file.
link_target="$(readlink ${BASH_SOURCE})"
exec_dir="${link_target%/*}"
else
###### this file is being directly executed.
###### therefore identify our parent directory.
exec_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
fi
exec_dir_trim_2="$( echo ${exec_dir} | cut -f 1,2,3 -d'/')"
exec_dir_trim_3="$( echo ${exec_dir} | cut -f 1,2,3,4 -d'/')"
if [ -f "${exec_dir_trim_2}/functions" ]
then
exec_dir_root="${exec_dir_trim_2}"
else
if [ -f "${exec_dir_trim_3}/functions" ]
then
exec_dir_root="${exec_dir_trim_3}"
else
echo "Functions file not found in any second or third level parent directory of: | ${exec_dir} |."
echo
echo "Exiting..."
echo
exit 1
fi
fi
##### source local functions file.
. "$exec_dir_root/functions"
##### define formatting.
synthia-define_formatting
##### check for root user runtime.
synthia-check_root
#### ###########################################################################
#### 3 | source dna and perform dna-bound operations.
#### ###########################################################################
##### source dna.
synthia-source_dna
##### define variables.
synthia-define_vars
##### read conf settings.
dna-read_conf_settings
##### touch temp dir.
dna-touch_tmp_project_dir
#### ###########################################################################
#### 4 | head/log script.
dna-log_script
### ############################################################################
### evaluate arguments.
### ############################################################################
while getopts ":e" arguments
do
case $arguments in
e)export clusterize_force_reinstall_etcd_cluster="y"
;;
\?) dna-echo -e "Invalid option | ${n-}-${OPTARG}${r-} | for function | ${n-}${FUNCNAME[0]}${r-} |."
dna-exit
;;
esac
done
OPTIND=1
### ############################################################################
### actually start script operations.
### ############################################################################
aenigma-clusterize
### ############################################################################