firmware: good-will nit-picking and some more work to do

This commit is contained in:
Franco Fichtner 2020-02-20 19:50:12 +01:00
parent 49afa0595e
commit 15fbeec367
5 changed files with 13 additions and 8 deletions

1
plist
View File

@ -606,6 +606,7 @@
/usr/local/opnsense/scripts/firmware/running.sh
/usr/local/opnsense/scripts/firmware/security.sh
/usr/local/opnsense/scripts/firmware/sets.sh
/usr/local/opnsense/scripts/firmware/sync.sh
/usr/local/opnsense/scripts/firmware/type.sh
/usr/local/opnsense/scripts/firmware/unlock.sh
/usr/local/opnsense/scripts/firmware/upgrade.sh

View File

@ -548,7 +548,7 @@ class FirmwareController extends ApiControllerBase
$response = array();
if ($this->request->isPost()) {
$response['status'] = strtolower(trim($backend->configdRun('firmware confplugins')));
$response['status'] = strtolower(trim($backend->configdRun('firmware sync')));
} else {
$response['status'] = 'failure';
}

View File

@ -35,10 +35,10 @@ lock
reinstall
remove
security
sync
type
unlock
upgrade
confplugins
"
SELECTED=${1}

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (C) 2020 Deciso B.V.
# Copyright (C) 2015-2017 Franco Fichtner <franco@opnsense.org>
# Copyright (C) 2015-2020 Franco Fichtner <franco@opnsense.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -26,12 +26,16 @@
# POSSIBILITY OF SUCH DAMAGE.
PKG_PROGRESS_FILE=/tmp/pkg_upgrade.progress
PACKAGES=`/usr/local/sbin/pluginctl -g system.firmware.plugins | /usr/bin/sed 's/,/ /g'`
# XXX the issue here is we do get all plugins, but some are already installed
PACKAGES=$(/usr/local/sbin/pluginctl -g system.firmware.plugins | /usr/bin/sed 's/,/ /g')
# Truncate upgrade progress file
: > ${PKG_PROGRESS_FILE}
echo "***GOT REQUEST TO INSTALL: $PACKAGES***" >> ${PKG_PROGRESS_FILE}
pkg install -y $PACKAGES >> ${PKG_PROGRESS_FILE} 2>&1
echo "***GOT REQUEST TO SYNC: ${PACKAGES}***" >> ${PKG_PROGRESS_FILE}
for PACKAGE in ${PACKAGES}; do
# XXX check which we really need to sync :)
pkg install -y ${PACKAGE} >> ${PKG_PROGRESS_FILE} 2>&1
done
pkg autoremove -y >> ${PKG_PROGRESS_FILE} 2>&1
echo '***DONE***' >> ${PKG_PROGRESS_FILE}

View File

@ -107,8 +107,8 @@ parameters:%s
type:script_output
message:Tested for presence of plugin %s
[confplugins]
command: /usr/sbin/daemon -f /usr/local/opnsense/scripts/firmware/launcher.sh confplugins
[sync]
command: /usr/sbin/daemon -f /usr/local/opnsense/scripts/firmware/launcher.sh sync
parameters:
type:script
message: install missing configured plugins