-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstart.sh
executable file
·53 lines (45 loc) · 1.45 KB
/
start.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
#!/bin/bash
#*****************************************************************************
#* Choose "Minimal Server" during the intstallation (works With Minimal ISO)
#*****************************************************************************
# --- Define github url for os_pre_lib
OS_PRE_LIB_GITHUB="https://github.com/charlietag/os_preparation_lib.git"
# --- Define filepath ---
## also in L_01_filepath.sh ##
CURRENT_SCRIPT="$(readlink -m $0)"
CURRENT_FOLDER="$(dirname "${CURRENT_SCRIPT}")"
# --- Define os_preparation_lib path ---
echo "#############################################"
echo " Preparing required lib"
echo "#############################################"
OS_PRE_LIB="${CURRENT_FOLDER}/../os_preparation_lib"
# ### Make sure os_preparation_lib exists correctly ###
RC=1
if [[ ! -d "${OS_PRE_LIB}" ]]; then
cd "$CURRENT_FOLDER/../"
echo "Downloading required lib..."
git clone $OS_PRE_LIB_GITHUB
RC=$?
else
cd $OS_PRE_LIB
echo "Updating required lib to lastest version..."
git pull
RC=$?
fi
if [[ $RC -ne 0 ]]; then
echo "Error occurs fetching github... !"
exit
fi
if [[ ! -d "${OS_PRE_LIB}" ]]; then
echo "${OS_PRE_LIB} does not exist... !"
exit
fi
echo ""
# ### Make sure os_preparation_lib exists correctly ###
# --- Start ---
echo "#############################################"
echo " Running start.sh"
echo "#############################################"
echo ""
cd $CURRENT_FOLDER
. "${OS_PRE_LIB}/lib/app.sh"