mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Merge pull request #3063 from csmithATsquiz/daily_autoupdate
Disabling auto-updates doesn't work
This commit is contained in:
@@ -18,6 +18,10 @@ if (isset($options['d'])) {
|
||||
}
|
||||
|
||||
if ($options['f'] === 'update') {
|
||||
if (!$config['update']) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$innodb_buffer = innodb_buffer_check();
|
||||
if ($innodb_buffer['used'] > $innodb_buffer['size']) {
|
||||
if (!empty($config['alert']['default_mail'])) {
|
||||
@@ -39,19 +43,14 @@ The ' . $config['project_name'] . ' team.';
|
||||
echo warn_innodb_buffer($innodb_buffer);
|
||||
exit(2);
|
||||
}
|
||||
else {
|
||||
if ($config['update']) {
|
||||
if ($config['update_channel'] == 'master') {
|
||||
exit(1);
|
||||
}
|
||||
elseif ($config['update_channel'] == 'release') {
|
||||
exit(3);
|
||||
}
|
||||
}
|
||||
else {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($config['update_channel'] == 'master') {
|
||||
exit(1);
|
||||
}
|
||||
elseif ($config['update_channel'] == 'release') {
|
||||
exit(3);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($options['f'] === 'syslog') {
|
||||
|
||||
@@ -33,7 +33,10 @@ status_run() {
|
||||
|
||||
if [ -z "$arg" ]; then
|
||||
up=$(php daily.php -f update >&2; echo $?)
|
||||
if [ "$up" -eq 1 ]; then
|
||||
if [ "$up" -eq 0 ]; then
|
||||
$0 no-code-update
|
||||
exit
|
||||
elif [ "$up" -eq 1 ]; then
|
||||
# Update to Master-Branch
|
||||
status_run 'Updating to latest codebase' 'git pull --quiet'
|
||||
elif [ "$up" -eq 3 ]; then
|
||||
@@ -49,6 +52,12 @@ if [ -z "$arg" ]; then
|
||||
fi
|
||||
else
|
||||
case $arg in
|
||||
no-code-update)
|
||||
# Updates of the code are disabled, just check for schema updates
|
||||
# and clean up the db.
|
||||
status_run 'Updating SQL-Schema' 'php includes/sql-schema/update.php'
|
||||
status_run 'Cleaning up DB' "$0 cleanup"
|
||||
;;
|
||||
post-pull)
|
||||
# List all tasks to do after pull in the order of execution
|
||||
status_run 'Updating SQL-Schema' 'php includes/sql-schema/update.php'
|
||||
|
||||
Reference in New Issue
Block a user