firmware: push automatic flags to firmware for #5025

This commit is contained in:
Franco Fichtner 2021-05-31 14:49:27 +02:00
parent 7ddb90cb79
commit a759338381
3 changed files with 6 additions and 6 deletions

View File

@ -792,7 +792,7 @@ class FirmwareController extends ApiControllerBase
$configPlugins = explode(",", $config->system->firmware->plugins);
}
$keys = array('name', 'version', 'comment', 'flatsize', 'locked', 'license', 'repository', 'origin');
$keys = array('name', 'version', 'comment', 'flatsize', 'locked', 'automatic', 'license', 'repository', 'origin');
$backend = new Backend();
$response = array();
@ -838,7 +838,7 @@ class FirmwareController extends ApiControllerBase
$translated['provided'] = '1';
}
$translated['path'] = "{$translated['repository']}/{$translated['origin']}";
$translated['configured'] = in_array($translated['name'], $configPlugins) ? '1' : '0';
$translated['configured'] = in_array($translated['name'], $configPlugins) || $translated['automatic'] == '1' ? '1' : '0';
$packages[$translated['name']] = $translated;
/* figure out local and remote plugins */

View File

@ -44,6 +44,6 @@ opnsense-update -Tb || BL=1
opnsense-update -Tk || KL=1
cat << EOF
${BN}${SEP}${BV}${SEP}${OS} userland set${SEP}${BS}${SEP}${BL}${SEP}${LIC}${SEP}${REPO}${SEP}
${KN}${SEP}${KV}${SEP}${OS} kernel set${SEP}${KS}${SEP}${KL}${SEP}${LIC}${SEP}${REPO}${SEP}
${BN}${SEP}${BV}${SEP}${OS} userland set${SEP}${BS}${SEP}${BL}${SEP}0${SEP}${LIC}${SEP}${REPO}${SEP}
${KN}${SEP}${KV}${SEP}${OS} kernel set${SEP}${KS}${SEP}${KL}${SEP}0${SEP}${LIC}${SEP}${REPO}${SEP}
EOF

View File

@ -151,14 +151,14 @@ type:script_output
message:Querying %s package details
[local]
command: pkg query "%n|||%v|||%c|||%sh|||%k|||%L|||%R|||%o"; \
command: pkg query "%n|||%v|||%c|||%sh|||%k|||%a|||%L|||%R|||%o"; \
/usr/local/opnsense/scripts/firmware/sets.sh '|||'
parameters:
type:script_output
message:view local packages
[remote]
command: pkg rquery "%n|||%v|||%c|||%sh|||0|||%L|||%R|||%o"
command: pkg rquery "%n|||%v|||%c|||%sh|||0|||0|||%L|||%R|||%o"
parameters:
type:script_output
message:view remote packages