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 {
107107 if ($ release ["prerelease " ] === false or isset ($ pkg_config ["allow_pre_release " ])) {
108108 # Loop through the assets of each release and check if our version of pfSense is supported
109109 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 " ) {
111111 # The first item of our list is the latest release, mark it as such.
112112 if ($ count === 0 ) {
113113 $ versions [$ release ["tag_name " ]] = $ release ["name " ] . " - Latest " ;
Original file line number Diff line number Diff line change 1414// See the License for the specific language governing permissions and
1515// limitations under the License.
1616require_once ("api/framework/APITools.inc " );
17+ require_once ("api/models/APISystemAPIVersionRead.inc " );
1718
1819function build_endpoints () {
1920 # Import each endpoint class
@@ -84,8 +85,9 @@ function sync() {
8485
8586function update () {
8687 $ pf_version = APITools \get_pfsense_version ()["base " ];
88+ $ latest_version = APISystemAPIVersionRead::get_latest_api_version ();
8789 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 " );
8991 echo shell_exec ("/etc/rc.restart_webgui " );
9092}
9193
You can’t perform that action at this time.
0 commit comments