diff --git a/daily.php b/daily.php index cc91d132d..7e42c4066 100644 --- a/daily.php +++ b/daily.php @@ -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') { diff --git a/daily.sh b/daily.sh index 17591fa8f..49dcb075e 100755 --- a/daily.sh +++ b/daily.sh @@ -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'