mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
sysutils/sftp-backup: replace getCurrentValue() use
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
PLUGIN_NAME= sftp-backup
|
||||
PLUGIN_VERSION= 1.1
|
||||
PLUGIN_REVISION= 1
|
||||
PLUGIN_COMMENT= Backup configurations using SFTP
|
||||
PLUGIN_MAINTAINER= ad@opnsense.org
|
||||
PLUGIN_TIER= 2
|
||||
|
||||
@@ -262,8 +262,8 @@ class Sftp extends Base implements IBackupProvider
|
||||
/* cleanup only if backup count is > 0*/
|
||||
if ($this->model->backupcount->asFloat() > 0) {
|
||||
rsort($remote_backups);
|
||||
if (count($remote_backups) > (int)$this->model->backupcount->getCurrentValue()) {
|
||||
for ($i = $this->model->backupcount->getCurrentValue(); $i < count($remote_backups); $i++) {
|
||||
if (count($remote_backups) > (int)$this->model->backupcount->getValue()) {
|
||||
for ($i = $this->model->backupcount->getValue(); $i < count($remote_backups); $i++) {
|
||||
$this->del($remote_backups[$i]);
|
||||
}
|
||||
$remote_backups = $this->ls(sprintf('%s*.xml', $fileprefix));
|
||||
|
||||
Reference in New Issue
Block a user