Refactor the way bootscript is override to reduce duplication

This commit is contained in:
Jamie Cameron
2022-08-13 11:40:31 -07:00
parent 0fe3479fb0
commit 95088a2bef
2 changed files with 5 additions and 5 deletions

View File

@@ -132,9 +132,9 @@ if ($upgrading) {
# Get current bootscript name
if (-r "$config_directory/bootscript-name") {
open(BOOTVAR, "$config_directory/bootscript-name");
chop($bootscript = <BOOTVAR>);
chop($newbootscript = <BOOTVAR>);
close(BOOTVAR);
$bootscript ||= ($ENV{'bootscript'} || "webmin");
$bootscript = $newbootscript if ($newbootscript);
}
# Force creation if non-existant

View File

@@ -159,9 +159,9 @@ if [ "$upgrading" = 1 ]; then
# Get current bootscript
if [ -r "$config_dir/bootscript-name" ]; then
bootscript=`cat $config_dir/bootscript-name`
if [ "$bootscript" = "" ]; then
bootscript="webmin"
newbootscript=`cat $config_dir/bootscript-name`
if [ "$newbootscript" != "" ]; then
bootscript="$newbootscript"
fi
fi