mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
firmware: move sets.sh into more portable query.sh and add tiers fetch #6374
This commit is contained in:
parent
c7f4c8f38b
commit
80af1c5ae9
2
plist
2
plist
@ -890,6 +890,7 @@
|
||||
/usr/local/opnsense/scripts/firmware/lock.sh
|
||||
/usr/local/opnsense/scripts/firmware/plugin.sh
|
||||
/usr/local/opnsense/scripts/firmware/product.php
|
||||
/usr/local/opnsense/scripts/firmware/query.sh
|
||||
/usr/local/opnsense/scripts/firmware/read.sh
|
||||
/usr/local/opnsense/scripts/firmware/reboot.sh
|
||||
/usr/local/opnsense/scripts/firmware/register.php
|
||||
@ -898,7 +899,6 @@
|
||||
/usr/local/opnsense/scripts/firmware/resync.sh
|
||||
/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/sync.subr.sh
|
||||
/usr/local/opnsense/scripts/firmware/unlock.sh
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2017-2021 Franco Fichtner <franco@opnsense.org>
|
||||
# Copyright (C) 2017-2023 Franco Fichtner <franco@opnsense.org>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -27,23 +27,38 @@
|
||||
LIC="BSD2CLAUSE"
|
||||
OS="FreeBSD"
|
||||
REPO="OPNsense"
|
||||
SEP=${1:-","}
|
||||
SEP="|||"
|
||||
|
||||
read BN BV BS << EOF
|
||||
case "${1}" in
|
||||
local)
|
||||
read BN BV BS << EOF
|
||||
$(opnsense-version -nvs base)
|
||||
EOF
|
||||
|
||||
read KN KV KS << EOF
|
||||
read KN KV KS << EOF
|
||||
$(opnsense-version -nvs kernel)
|
||||
EOF
|
||||
|
||||
BL=0
|
||||
KL=0
|
||||
BL=0
|
||||
KL=0
|
||||
|
||||
opnsense-update -Tb || BL=1
|
||||
opnsense-update -Tk || KL=1
|
||||
opnsense-update -Tb || BL=1
|
||||
opnsense-update -Tk || KL=1
|
||||
|
||||
cat << EOF
|
||||
${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}
|
||||
${BN}${SEP}${BV}${SEP}${OS} userland set${SEP}${BS}${SEP}${BL}${SEP}0${SEP}${LIC}${SEP}${REPO}${SEP}opnsense/base
|
||||
${KN}${SEP}${KV}${SEP}${OS} kernel set${SEP}${KS}${SEP}${KL}${SEP}0${SEP}${LIC}${SEP}${REPO}${SEP}opnsense/kernel
|
||||
EOF
|
||||
|
||||
pkg query "%n|||%v|||%c|||%sh|||%k|||%a|||%L|||%R|||%o"
|
||||
;;
|
||||
remote)
|
||||
pkg update -q && pkg rquery -U "%n|||%v|||%c|||%sh|||0|||0|||%L|||%R|||%o"
|
||||
;;
|
||||
tiers)
|
||||
# fetching annotations is not as easy to query so always ask for annotations from remote end
|
||||
pkg update -q && pkg rquery '%n|||%At|||%Av' | grep '|||product_tier|||'
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
@ -181,18 +181,23 @@ type:script_output
|
||||
message:Querying %s package details
|
||||
|
||||
[local]
|
||||
command:pkg query "%n|||%v|||%c|||%sh|||%k|||%a|||%L|||%R|||%o"; \
|
||||
/usr/local/opnsense/scripts/firmware/sets.sh '|||'
|
||||
command:/usr/local/opnsense/scripts/firmware/query.sh local
|
||||
parameters:
|
||||
type:script_output
|
||||
message:view local packages
|
||||
|
||||
[remote]
|
||||
command:pkg update -q && pkg rquery -U "%n|||%v|||%c|||%sh|||0|||0|||%L|||%R|||%o"
|
||||
command:/usr/local/opnsense/scripts/firmware/query.sh remote
|
||||
parameters:
|
||||
type:script_output
|
||||
message:view remote packages
|
||||
|
||||
[tiers]
|
||||
command:/usr/local/opnsense/scripts/firmware/query.sh tiers
|
||||
parameters:
|
||||
type:script_output
|
||||
message:view plugin tiers
|
||||
|
||||
[product]
|
||||
command:/usr/local/opnsense/scripts/firmware/product.php
|
||||
parameters:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user