Skip to content

Commit

Permalink
2.2.0.3: Fix missing BINARIES section in general.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
christianTF committed Oct 30, 2020
1 parent e137acd commit 3be5742
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/system/general.cfg.default
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LANG=en
INSTALLFOLDER=/opt/loxberry
STARTSETUP=1
SENDSTATISTIC=1
VERSION=2.2.0.2
VERSION=2.2.0.3
SYSTEMLOGLEVEL=6

[UPDATE]
Expand Down
2 changes: 1 addition & 1 deletion config/system/general.json.default
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Sendstatistic" : 1,
"Startsetup" : "1",
"Systemloglevel" : "6",
"Version" : "2.2.0.2"
"Version" : "2.2.0.3"
},
"Healthcheck" : null,
"Miniserver" : {
Expand Down
45 changes: 45 additions & 0 deletions sbin/loxberryupdate/update_v2.2.0.3.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/perl

# Input parameters from loxberryupdate.pl:
# release: the final version update is going to (not the version of the script)
# logfilename: The filename of LoxBerry::Log where the script can append
# updatedir: The directory where the update resides
# cron: If 1, the update was triggered automatically by cron

use LoxBerry::Update;

init();

# Correct missing BINARIES section in legacy general.cfg

LOGINF "Checking your general.cfg for missing binaries section...";
eval {
use Config::Simple;
my $generalcfg = new Config::Simple("$lbsconfigdir/general.cfg");
if( $generalcfg->param("BINARIES.POWEROFF") eq "" ) {
LOGINF "general.cfg binaries section missing - fixing...";
require LoxBerry::System::General;
my $jsonobj = LoxBerry::System::General->new();
my $cfg = $jsonobj->open( readonly => 1 );
$jsonobj->_json2cfg();
LOGOK "general.cfg binaries section added.";
} else {
LOGOK "general.cfg binaries section is correct. Nothing to do.";
}
};
if( $@ ) {
LOGWARN "Could not read general.cfg - possibly not yet existing";
}




## If this script needs a reboot, a reboot.required file will be created or appended
# LOGWARN "Update file $0 requests a reboot of LoxBerry. Please reboot your LoxBerry after the installation has finished.";
# reboot_required("LoxBerry Update requests a reboot.");

LOGOK "Update script $0 finished." if ($errors == 0);
LOGERR "Update script $0 finished with errors." if ($errors != 0);

# End of script
exit($errors);

0 comments on commit 3be5742

Please sign in to comment.