Commit 5f5e438f authored by Franco Fichtner's avatar Franco Fichtner

firmware: pull changelog fetch out of check

We want to pull changelogs also when we look for upgrade instructions,
in order to safely show then afterwards if we can indeed upgrade from
there.
parent ae54d392
......@@ -47,6 +47,7 @@ class FirmwareController extends ApiControllerBase
{
$this->sessionClose(); // long running action, close session
$backend = new Backend();
$backend->configdRun('firmware changelog fetch');
$response = json_decode(trim($backend->configdRun('firmware check')), true);
if ($response != null) {
......@@ -171,7 +172,13 @@ class FirmwareController extends ApiControllerBase
$backend = new Backend();
$response = array();
if ($this->request->isPost()) {
if (!$this->request->isPost()) {
return $response;
}
if (empty($version)) {
$backend->configdRun('firmware changelog fetch');
} else {
// sanitize package name
$filter = new \Phalcon\Filter();
$filter->add('version', function ($value) {
......
......@@ -54,7 +54,7 @@ download_size="none"
itemcount=0
linecount=0
timer=0
timeout=30 # Wait for a maximum number of seconds to determine connection issues
timeout=45 # Wait for a maximum number of seconds to determine connection issues
# File location variables
tmp_pkg_output_file="/tmp/packages.output"
......@@ -63,8 +63,6 @@ tmp_pkg_update_file="/tmp/pkg_updates.output"
# Check if pkg is already runnig
pkg_running=`ps -x | grep "pkg " | grep -v "grep"`
if [ "$pkg_running" == "" ]; then
# load changelogs first
/usr/local/opnsense/scripts/firmware/changelog.sh fetch
# start pkg update
pkg update -f > $tmp_pkg_update_file &
pkg_running="started" # Set running state to arbitrary value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment