File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff 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
117130set_default_value () {
118131 eval variable=\$ $1
Original file line number Diff line number Diff 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
117130set_default_value () {
118131 eval variable=\$ $1
You can’t perform that action at this time.
0 commit comments