File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
usr/local/share/pfSense-pkg-API Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ class APISystemAPIVersionRead extends APIModel {
107
107
if ($ release ["prerelease " ] === false or isset ($ pkg_config ["allow_pre_release " ])) {
108
108
# Loop through the assets of each release and check if our version of pfSense is supported
109
109
foreach ($ release ["assets " ] as $ asset ) {
110
- if (str_starts_with ( $ asset ["name " ], "pfSense- " . $ pf_version) ) {
110
+ if ($ asset ["name " ] === "pfSense- $ pf_version-pkg-API.pkg " ) {
111
111
# The first item of our list is the latest release, mark it as such.
112
112
if ($ count === 0 ) {
113
113
$ versions [$ release ["tag_name " ]] = $ release ["name " ] . " - Latest " ;
Original file line number Diff line number Diff line change 14
14
// See the License for the specific language governing permissions and
15
15
// limitations under the License.
16
16
require_once ("api/framework/APITools.inc " );
17
+ require_once ("api/models/APISystemAPIVersionRead.inc " );
17
18
18
19
function build_endpoints () {
19
20
# Import each endpoint class
@@ -84,8 +85,9 @@ function sync() {
84
85
85
86
function update () {
86
87
$ pf_version = APITools \get_pfsense_version ()["base " ];
88
+ $ latest_version = APISystemAPIVersionRead::get_latest_api_version ();
87
89
echo shell_exec ("/usr/sbin/pkg delete -y pfSense-pkg-API " );
88
- echo shell_exec ("/usr/sbin/pkg -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/latest/ download/pfSense- " .$ pf_version ."-pkg-API.pkg " );
90
+ echo shell_exec ("/usr/sbin/pkg -C /dev/null add https://github.com/jaredhendrickson13/pfsense-api/releases/download/ $ latest_version /pfSense- " .$ pf_version ."-pkg-API.pkg " );
89
91
echo shell_exec ("/etc/rc.restart_webgui " );
90
92
}
91
93
You can’t perform that action at this time.
0 commit comments