Skip to content

Commit 7f18bb4

Browse files
authored
Add source_conf to the installer we don't load main.sh in the installer (hestiacp#3939)
1 parent 68b9ab1 commit 7f18bb4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

install/hst-install-debian.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ check_result() {
113113
fi
114114
}
115115

116+
# Source conf in installer
117+
source_conf() {
118+
while IFS='= ' read -r lhs rhs; do
119+
if [[ ! $lhs =~ ^\ *# && -n $lhs ]]; then
120+
rhs="${rhs%%^\#*}" # Del in line right comments
121+
rhs="${rhs%%*( )}" # Del trailing spaces
122+
rhs="${rhs%\'*}" # Del opening string quotes
123+
rhs="${rhs#\'*}" # Del closing string quotes
124+
declare -g $lhs="$rhs"
125+
fi
126+
done < $1
127+
}
128+
116129
# Defining function to set default value
117130
set_default_value() {
118131
eval variable=\$$1

install/hst-install-ubuntu.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ check_result() {
113113
fi
114114
}
115115

116+
# Source conf in installer
117+
source_conf() {
118+
while IFS='= ' read -r lhs rhs; do
119+
if [[ ! $lhs =~ ^\ *# && -n $lhs ]]; then
120+
rhs="${rhs%%^\#*}" # Del in line right comments
121+
rhs="${rhs%%*( )}" # Del trailing spaces
122+
rhs="${rhs%\'*}" # Del opening string quotes
123+
rhs="${rhs#\'*}" # Del closing string quotes
124+
declare -g $lhs="$rhs"
125+
fi
126+
done < $1
127+
}
128+
116129
# Defining function to set default value
117130
set_default_value() {
118131
eval variable=\$$1

0 commit comments

Comments
 (0)