Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b9b930b48 |
+19
-8
@@ -1081,11 +1081,13 @@ class Bot
|
|||||||
[$start, $period] = explode('/', $c['backup']);
|
[$start, $period] = explode('/', $c['backup']);
|
||||||
$start = strtotime($start);
|
$start = strtotime($start);
|
||||||
$period = strtotime($period, 0);
|
$period = strtotime($period, 0);
|
||||||
if ($now - $start >= $period && ($now - $start) % $period == 0) {
|
if (!empty($start) && !empty($period)) {
|
||||||
if (!empty($c['pinbackup'])) {
|
if ($now - $start >= $period && ($now - $start) % $period == 0) {
|
||||||
$this->pinAdmin($c['pinbackup'], 1);
|
if (!empty($c['pinbackup'])) {
|
||||||
|
$this->pinAdmin($c['pinbackup'], 1);
|
||||||
|
}
|
||||||
|
$this->pinBackup();
|
||||||
}
|
}
|
||||||
$this->pinBackup();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1296,7 +1298,7 @@ class Bot
|
|||||||
if (!empty($file)) {
|
if (!empty($file)) {
|
||||||
file_put_contents($file, $json);
|
file_put_contents($file, $json);
|
||||||
}
|
}
|
||||||
$bot = $this->request('getMyName', [])['result']['name'];
|
$bot = preg_replace('~[\W]~iu', '_', $this->request('getMyName', [])['result']['name']);
|
||||||
return $this->upload("{$bot}_export_" . date('d_m_Y_H_i') . '.json', $json);
|
return $this->upload("{$bot}_export_" . date('d_m_Y_H_i') . '.json', $json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3843,9 +3845,10 @@ DNS-over-HTTPS with IP:
|
|||||||
public function menu($type = false, $arg = false, $return = false)
|
public function menu($type = false, $arg = false, $return = false)
|
||||||
{
|
{
|
||||||
$domain = $this->getPacConf()['domain'] ?: $this->ip;
|
$domain = $this->getPacConf()['domain'] ?: $this->ip;
|
||||||
|
$cron = exec('pgrep -f cron.php');
|
||||||
$menu = [
|
$menu = [
|
||||||
'main' => [
|
'main' => [
|
||||||
'text' => 'v' . getenv('VER'),
|
'text' => 'v' . getenv('VER') . "\ncron: " . $this->i18n($cron ? 'on' : 'off') . ($cron ? '' : ' show <code>logs/php_error</code>'),
|
||||||
'data' => [
|
'data' => [
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
@@ -5565,7 +5568,11 @@ DNS-over-HTTPS with IP:
|
|||||||
];
|
];
|
||||||
$backup = array_filter(explode('/', $conf['backup']));
|
$backup = array_filter(explode('/', $conf['backup']));
|
||||||
if (!empty($backup)) {
|
if (!empty($backup)) {
|
||||||
$backup = "{$backup[0]} start / {$backup[1]} period";
|
if (!empty(strtotime($backup[0])) && !empty(strtotime($backup[1]))) {
|
||||||
|
$backup = "{$backup[0]} start / {$backup[1]} period";
|
||||||
|
} else {
|
||||||
|
$backup = $this->i18n('off') . " {$conf['backup']} - wrong format";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$data[] = [
|
$data[] = [
|
||||||
[
|
[
|
||||||
@@ -5875,7 +5882,11 @@ DNS-over-HTTPS with IP:
|
|||||||
$c['backup'] = '';
|
$c['backup'] = '';
|
||||||
} else {
|
} else {
|
||||||
[$start, $period] = explode('/', $text);
|
[$start, $period] = explode('/', $text);
|
||||||
$c['backup'] = implode(' / ', [date('Y-m-d H:i', strtotime($start)), trim($period)]);
|
if (!empty(strtotime($start)) && !empty(strtotime($period))) {
|
||||||
|
$c['backup'] = implode(' / ', [date('Y-m-d H:i', strtotime($start)), trim($period)]);
|
||||||
|
} else {
|
||||||
|
$this->send($this->input['from'], $this->input['message'] . ' - wrong format');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($c['pinbackup']) {
|
if ($c['pinbackup']) {
|
||||||
$this->pinAdmin($c['pinbackup'], 1);
|
$this->pinAdmin($c['pinbackup'], 1);
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
23.10.2024 v1.77
|
||||||
|
- вывод статуса cron
|
||||||
|
- фикс с отправкой бэкапа при спецсимволах в названии бота
|
||||||
|
- проверка формата времени в автобэкапе
|
||||||
22.10.2024 v1.76
|
22.10.2024 v1.76
|
||||||
- улучшение определения ip бота при старте
|
- улучшение определения ip бота при старте
|
||||||
22.10.2024 v1.75
|
22.10.2024 v1.75
|
||||||
|
|||||||
Reference in New Issue
Block a user