File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 4848 sed -i " s|$key =.*|$key ='$value '|g" $HESTIA /conf/hestia.conf
4949fi
5050
51+ # Sort configuration file in alphabetical order on change
52+ sort $HESTIA /conf/hestia.conf -o /tmp/updconf
53+ mv $HESTIA /conf/hestia.conf $HESTIA /conf/hestia.conf.bak
54+ mv /tmp/updconf $HESTIA /conf/hestia.conf
55+ rm -f $HESTIA /conf/hestia.conf.bak
56+
5157# ----------------------------------------------------------#
5258# Hestia #
5359# ----------------------------------------------------------#
Original file line number Diff line number Diff line change @@ -156,6 +156,20 @@ write_config_value() {
156156 echo " $key ='$value '" >> $HESTIA /conf/hestia.conf
157157}
158158
159+ # Sort configuration file values
160+ # Write final copy to $HESTIA/conf/hestia.conf for active usage
161+ # Duplicate file to $HESTIA/conf/defaults/hestia.conf to restore known good installation values
162+ sort_config_file (){
163+ sort $HESTIA /conf/hestia.conf -o /tmp/updconf
164+ mv $HESTIA /conf/hestia.conf $HESTIA /conf/hestia.conf.bak
165+ mv /tmp/updconf $HESTIA /conf/hestia.conf
166+ rm -f $HESTIA /conf/hestia.conf.bak
167+ if [ ! -d " $HESTIA /conf/defaults/" ]; then
168+ mkdir -p " $HESTIA /conf/defaults/"
169+ fi
170+ cp $HESTIA /conf/hestia.conf $HESTIA /conf/defaults/hestia.conf
171+ }
172+
159173# ----------------------------------------------------------#
160174# Verifications #
161175# ----------------------------------------------------------#
@@ -1875,4 +1889,8 @@ if [ "$interactive" = 'yes' ]; then
18751889 fi
18761890fi
18771891
1892+ # Clean-up
1893+ # Sort final configuration file
1894+ sort_config_file
1895+
18781896# EOF
Original file line number Diff line number Diff line change @@ -137,6 +137,20 @@ write_config_value() {
137137 echo " $key ='$value '" >> $HESTIA /conf/hestia.conf
138138}
139139
140+ # Sort configuration file values
141+ # Write final copy to $HESTIA/conf/hestia.conf for active usage
142+ # Duplicate file to $HESTIA/conf/defaults/hestia.conf to restore known good installation values
143+ sort_config_file (){
144+ sort $HESTIA /conf/hestia.conf -o /tmp/updconf
145+ mv $HESTIA /conf/hestia.conf $HESTIA /conf/hestia.conf.bak
146+ mv /tmp/updconf $HESTIA /conf/hestia.conf
147+ rm -f $HESTIA /conf/hestia.conf.bak
148+ if [ ! -d " $HESTIA /conf/defaults/" ]; then
149+ mkdir -p " $HESTIA /conf/defaults/"
150+ fi
151+ cp $HESTIA /conf/hestia.conf $HESTIA /conf/defaults/hestia.conf
152+ }
153+
140154# ----------------------------------------------------------#
141155# Verifications #
142156# ----------------------------------------------------------#
@@ -1909,4 +1923,8 @@ if [ "$interactive" = 'yes' ]; then
19091923 fi
19101924fi
19111925
1926+ # Clean-up
1927+ # Sort final configuration file
1928+ sort_config_file
1929+
19121930# EOF
You can’t perform that action at this time.
0 commit comments