forked from nextcloud/vm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nextcloud_update.sh
613 lines (545 loc) · 19.3 KB
/
nextcloud_update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
#!/bin/bash
#################################################################################################################
# DO NOT USE THIS SCRIPT WHEN UPDATING NEXTCLOUD / YOUR SERVER! RUN `sudo bash /var/scripts/update.sh` INSTEAD. #
#################################################################################################################
# shellcheck disable=2034,2059
true
# shellcheck source=lib.sh
NCDB=1 && NC_UPDATE=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
unset NC_UPDATE
unset NCDB
# T&M Hansson IT AB © - 2019, https://www.hanssonit.se/
# Check for errors + debug code and abort if something isn't right
# 1 = ON
# 0 = OFF
DEBUG=0
debug_mode
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
# Must be root
root_check
# Check if dpkg or apt is running
is_process_running apt
is_process_running dpkg
# Check if /boot is filled more than 90% and exit the script if that's the case since we don't want to end up with a broken system
if [ -d /boot ]
then
if [[ "$(df -h | grep /boot | awk '{print $5}' | cut -d "%" -f1)" -gt 90 ]]
then
msg_box "It seems like your boot drive is filled more than 90%. You can't proceed to upgrade since it probably will break your system
To be able to proceed with the update you need to delete some old Linux kernels. If you need support, please visit:
https://shop.hanssonit.se/product/premium-support-per-30-minutes/"
exit
fi
fi
# System Upgrade
if is_this_installed mysql-common
then
apt-mark hold mysql*
if is_this_installed mariadb-common
then
apt-mark hold mariadb*
fi
fi
# Move all logs to new dir (2019-09-04)
if [ -d /var/log/ncvm/ ]
then
rsync -az /var/log/ncvm/ $VMLOGS
rm -Rf /var/log/ncvm/
fi
# Update docker-ce to overlay2 since devicemapper is deprecated
if [ -f /etc/systemd/system/docker.service ]
then
if grep -q "devicemapper" /etc/systemd/system/docker.service
then
print_text_in_color "$ICyan" "Changing to Overlay2 for Docker CE..."
print_text_in_color "$ICyan" "Please report any issues to $ISSUES."
run_static_script docker_overlay2
elif grep -q "aufs" /etc/default/docker
then
apt-mark hold docker-ce
run_static_script docker_overlay2
fi
fi
apt update -q4 & spinner_loading
export DEBIAN_FRONTEND=noninteractive ; apt dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
if is_this_installed mysql-common
then
apt-mark unhold mysql*
print_text_in_color "$ICyan" "If you want to upgrade MySQL/MariaDB, please run 'sudo apt update && sudo apt dist-upgrade -y'"
sleep 2
if is_this_installed mariadb-common
then
apt-mark unhold mariadb*
print_text_in_color "$ICyan" "If you want to upgrade MariaDB, please run 'sudo apt update && sudo apt dist-upgrade -y'"
sleep 2
fi
fi
# Update Netdata
if [ -d /etc/netdata ]
then
if [ -f /usr/src/netdata.git/netdata-updater.sh ]
then
run_app_script netdata
elif [ -f /usr/libexec/netdata-updater.sh ]
then
bash /usr/libexec/netdata-updater.sh
fi
fi
# Update Redis PHP extension
print_text_in_color "$ICyan" "Trying to upgrade the Redis PECL extension..."
if version 18.04 "$DISTRO" 18.04.10; then
if ! pecl list | grep redis >/dev/null 2>&1
then
if is_this_installed php"$PHPVER"-common
then
install_if_not php"$PHPVER"-dev
elif is_this_installed php7.0-common
then
install_if_not php7.0-dev
elif is_this_installed php7.1-common
then
install_if_not php7.1-dev
elif is_this_installed php7.3-common
then
install_if_not php7.3-dev
fi
apt purge php-redis -y
apt autoremove -y
pecl channel-update pecl.php.net
yes no | pecl install redis
service redis-server restart
# Check if redis.so is enabled
# PHP 7.0 apache
if [ -f /etc/php/7.0/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/7.0/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.0/apache2/php.ini
# PHP "$PHPVER" apache
elif [ -f /etc/php/"$PHPVER"/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/"$PHPVER"/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/"$PHPVER"/apache2/php.ini
# PHP "$PHPVER" fpm
elif [ -f "$PHP_INI" ]
then
! [[ "$(grep -R extension=redis.so "$PHP_INI")" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> "$PHP_INI"
fi
restart_webserver
elif pecl list | grep redis >/dev/null 2>&1
then
if is_this_installed php"$PHPVER"-common
then
install_if_not php"$PHPVER"-dev
elif is_this_installed php7.0-common
then
install_if_not php7.0-dev
elif is_this_installed php7.1-common
then
install_if_not php7.1-dev
elif is_this_installed php7.3-common
then
install_if_not php7.3-dev
fi
pecl channel-update pecl.php.net
yes no | pecl upgrade redis
service redis-server restart
# Check if redis.so is enabled
# PHP 7.0 apache
if [ -f /etc/php/7.0/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/7.0/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.0/apache2/php.ini
# PHP "$PHPVER" apache
elif [ -f /etc/php/"$PHPVER"/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/"$PHPVER"/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/"$PHPVER"/apache2/php.ini
# PHP "$PHPVER" fpm
elif [ -f "$PHP_INI" ]
then
! [[ "$(grep -R extension=redis.so "$PHP_INI")" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> "$PHP_INI"
fi
restart_webserver
fi
else
msg_box "Ubuntu version $DISTRO must be at least 18.04 to upgrade Redis."
fi
# Upgrade APCu and igbinary
if [ "${CURRENTVERSION%%.*}" -ge "17" ]
then
if [ -f "$PHP_INI" ]
then
print_text_in_color "$ICyan" "Trying to upgrade igbinary and APCu..."
if pecl list | grep igbinary >/dev/null 2>&1
then
yes no | pecl upgrade igbinary
# Check if igbinary.so is enabled
if ! grep -qFx extension=igbinary.so "$PHP_INI"
then
echo "extension=igbinary.so" >> "$PHP_INI"
fi
fi
if pecl list | grep apcu >/dev/null 2>&1
then
yes no | pecl upgrade apcu
# Check if apcu.so is enabled
if ! grep -qFx extension=apcu.so "$PHP_INI"
then
echo "extension=apcu.so" >> "$PHP_INI"
fi
fi
fi
fi
# Update adminer
if [ -d $ADMINERDIR ]
then
print_text_in_color "$ICyan" "Updating Adminer..."
rm -f "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php
curl_to_dir "http://www.adminer.org" "latest.php" "$ADMINERDIR"
ln -s "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php
fi
# Run watchtower to update all Docker images
if is_docker_running
then
# Remove old watchtower if existing
if does_this_docker_exist v2tec/watchtower
then
# Get Env values (https://github.com/koalaman/shellcheck/issues/1601)
get_env_values() {
# shellcheck disable=SC2016
docker inspect -f '{{range $index, $value := .Config.Env}}{{$value}}{{println}}{{end}}' watchtower > env.list
}
get_env_values
# Remove empty lines
sed -i '/^[[:space:]]*$/d' env.list
# Get Cmd values
CmdDocker=$(docker inspect --format='{{.Config.Cmd}}' watchtower | cut -d "]" -f 1 | cut -d "[" -f 2;)
# Check if env.list is empty and run the docker accordingly
if [ -s env.list ]
then
docker_prune_this v2tec/watchtower
docker run -d --restart=unless-stopped --name watchtower -v /var/run/docker.sock:/var/run/docker.sock --env-file ./env.list containrrr/watchtower "$CmdDocker"
rm -f env.list
else
docker_prune_this v2tec/watchtower
docker run -d --restart=unless-stopped --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower "$CmdDocker"
fi
fi
# Get the new watchtower docker
if ! does_this_docker_exist containrrr/watchtower
then
docker run -d --restart=unless-stopped --name watchtower -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --cleanup --interval 3600
fi
fi
# Cleanup un-used packages
apt autoremove -y
apt autoclean
# Update GRUB, just in case
update-grub
# Remove update lists
rm /var/lib/apt/lists/* -r
# Free some space (ZFS snapshots)
if is_this_installed libzfs2linux
then
if grep -rq ncdata /etc/mtab
then
run_static_script prune_zfs_snaphots
fi
fi
# Fix bug in nextcloud.sh
CURRUSR="$(getent group sudo | cut -d: -f4 | cut -d, -f1)"
if grep -q "6.ifcfg.me" $SCRIPTS/nextcloud.sh &>/dev/null
then
rm -f "$SCRIPTS/nextcloud.sh"
download_static_script nextcloud
chown "$CURRUSR":"$CURRUSR" "$SCRIPTS/nextcloud.sh"
chmod +x "$SCRIPTS/nextcloud.sh"
elif [ -f $SCRIPTS/techandme.sh ]
then
rm -f "$SCRIPTS/techandme.sh"
download_static_script nextcloud
chown "$CURRUSR":"$CURRUSR" "$SCRIPTS/nextcloud.sh"
chmod +x "$SCRIPTS/nextcloud.sh"
if [ -f /home/"$CURRUSR"/.bash_profile ]
then
sed -i "s|techandme|nextcloud|g" /home/"$CURRUSR"/.bash_profile
elif [ -f /home/"$CURRUSR"/.profile ]
then
sed -i "s|techandme|nextcloud|g" /home/"$CURRUSR"/.profile
fi
fi
# Set secure permissions
if [ ! -f "$SECURE" ]
then
mkdir -p "$SCRIPTS"
download_static_script setup_secure_permissions_nextcloud
chmod +x "$SECURE"
fi
# Update all Nextcloud apps
if [ "${CURRENTVERSION%%.*}" -ge "15" ]
then
occ_command app:update --all
fi
# Nextcloud 13 is required.
lowest_compatible_nc 13
# Major versions unsupported
if [ "${CURRENTVERSION%%.*}" == "$NCBAD" ]
then
msg_box "Please note that updates between multiple major versions are unsupported! Your situation is:
Current version: $CURRENTVERSION
Latest release: $NCVERSION
It is best to keep your Nextcloud server upgraded regularly, and to install all point releases
and major releases without skipping any of them, as skipping releases increases the risk of
errors. Major releases are 13, 14, 15 and 16. Point releases are intermediate releases for each
major release. For example, 14.0.52 and 15.0.2 are point releases.
Please contact T&M Hansson IT AB to help you with upgrading between major versions.
https://shop.hanssonit.se/product/upgrade-between-major-owncloud-nextcloud-versions/"
exit 1
fi
# Check if new version is larger than current version installed.
if version_gt "$NCVERSION" "$CURRENTVERSION"
then
print_text_in_color "$ICyan" "Latest release is: $NCVERSION. Current version is: $CURRENTVERSION."
print_text_in_color "$IGreen" "New version available! Upgrade continues..."
else
print_text_in_color "$ICyan" "Latest version is: $NCVERSION. Current version is: $CURRENTVERSION."
print_text_in_color "$ICyan" "No need to upgrade, this script will exit..."
exit 0
fi
# Check if PHP version is compatible with $NCVERSION
PHP_VER=71
NC_VER=16
if [ "${NCVERSION%%.*}" -ge "$NC_VER" ]
then
if [ "$(php -v | head -n 1 | cut -d " " -f 2 | cut -c 1,3)" -lt "$PHP_VER" ]
then
msg_box "Your PHP version isn't compatible with the new version of Nextcloud. Please upgrade your PHP stack and try again.
If you need support, please visit https://shop.hanssonit.se/product/premium-support-per-30-minutes/"
exit
fi
fi
# Upgrade Nextcloud
if ! site_200 $NCREPO
then
msg_box "$NCREPO seems to be down, or temporarily not reachable. Please try again in a few minutes."
exit 1
fi
countdown "Backing up files and upgrading to Nextcloud $NCVERSION in 10 seconds... Press CTRL+C to abort." "10"
# Stop Apache2
check_command service apache2 stop
# Create backup dir (/mnt/NCBACKUP/)
if [ ! -d "$BACKUP" ]
then
BACKUP=/var/NCBACKUP
mkdir -p $BACKUP
fi
# Backup PostgreSQL
if is_this_installed psql
then
cd /tmp
if sudo -u postgres psql -c "SELECT 1 AS result FROM pg_database WHERE datname='$NCCONFIGDB'" | grep "1 row" > /dev/null
then
print_text_in_color "$ICyan" "Doing pgdump of $NCCONFIGDB..."
check_command sudo -u postgres pg_dump "$NCCONFIGDB" > "$BACKUP"/nextclouddb.sql
else
print_text_in_color "$ICyan" "Doing pgdump of all databases..."
check_command sudo -u postgres pg_dumpall > "$BACKUP"/alldatabases.sql
fi
fi
# If MariaDB then:
mariadb_backup() {
MYCNF=/root/.my.cnf
MARIADBMYCNFPASS=$(grep "password" $MYCNF | sed -n "/password/s/^password='\(.*\)'$/\1/p")
NCCONFIGDB=$(grep "dbname" $NCPATH/config/config.php | awk '{print $3}' | sed "s/[',]//g")
NCCONFIGDBPASS=$(grep "dbpassword" $NCPATH/config/config.php | awk '{print $3}' | sed "s/[',]//g")
# Path to specific files
# Make sure old instaces can upgrade as well
if [ ! -f "$MYCNF" ] && [ -f /var/mysql_password.txt ]
then
regressionpw=$(cat /var/mysql_password.txt)
cat << LOGIN > "$MYCNF"
[client]
password='$regressionpw'
LOGIN
chmod 0600 $MYCNF
chown root:root $MYCNF
msg_box "Please restart the upgrade process, we fixed the password file $MYCNF."
exit 1
elif [ -z "$MARIADBMYCNFPASS" ] && [ -f /var/mysql_password.txt ]
then
regressionpw=$(cat /var/mysql_password.txt)
{
echo "[client]"
echo "password='$regressionpw'"
} >> "$MYCNF"
msg_box "Please restart the upgrade process, we fixed the password file $MYCNF."
exit 1
fi
# Backup MariaDB
if mysql -u root -p"$MARIADBMYCNFPASS" -e "SHOW DATABASES LIKE '$NCCONFIGDB'" > /dev/null
then
print_text_in_color "$ICyan" "Doing mysqldump of $NCCONFIGDB..."
check_command mysqldump -u root -p"$MARIADBMYCNFPASS" -d "$NCCONFIGDB" > "$BACKUP"/nextclouddb.sql
else
print_text_in_color "$ICyan" "Doing mysqldump of all databases..."
check_command mysqldump -u root -p"$MARIADBMYCNFPASS" -d --all-databases > "$BACKUP"/alldatabases.sql
fi
}
# Do the actual backup
if is_this_installed mysql-common && ! is_this_installed postgresql-common
then
mariadb_backup
elif is_this_installed mariadb-common && ! is_this_installed postgresql-common
then
mariadb_backup
fi
# Check if backup exists and move to old
print_text_in_color "$ICyan" "Backing up data..."
DATE=$(date +%Y-%m-%d-%H%M%S)
if [ -d "$BACKUP" ]
then
mkdir -p "$BACKUP"-OLD/"$DATE"
install_if_not rsync
rsync -avz --progress "$BACKUP"/ "$BACKUP"-OLD/"$DATE"
rm -R "$BACKUP"
mkdir -p "$BACKUP"
fi
# Do a backup of the ZFS mount
if is_this_installed libzfs2linux
then
if grep -rq ncdata /etc/mtab
then
check_multiverse
install_if_not zfs-auto-snapshot
sed -i "s|date --utc|date|g" /usr/sbin/zfs-auto-snapshot
check_command zfs-auto-snapshot -r ncdata
fi
fi
# Backup data
for folders in config apps
do
if [[ "$(rsync -Aax $NCPATH/$folders $BACKUP)" -eq 0 ]]
then
BACKUP_OK=1
else
unset BACKUP_OK
fi
done
if [ -z $BACKUP_OK ]
then
msg_box "Backup was not OK. Please check $BACKUP and see if the folders are backed up properly"
exit 1
else
printf "${IGreen}\nBackup OK!${Color_Off}\n"
fi
# Download and validate Nextcloud package
check_command download_verify_nextcloud_stable
if [ -f "$HTML/$STABLEVERSION.tar.bz2" ]
then
print_text_in_color "$ICyan" "$HTML/$STABLEVERSION.tar.bz2 exists"
else
msg_box "Aborting, something went wrong with the download"
exit 1
fi
if [ -d $BACKUP/config/ ]
then
print_text_in_color "$ICyan" "$BACKUP/config/ exists"
else
msg_box "Something went wrong with backing up your old nextcloud instance
Please check in $BACKUP if config/ folder exist."
exit 1
fi
if [ -d $BACKUP/apps/ ]
then
print_text_in_color "$ICyan" "$BACKUP/apps/ exists"
echo
printf "${IGreen}All files are backed up.${Color_Off}\n"
occ_command maintenance:mode --on
countdown "Removing old Nextcloud instance in 5 seconds..." "5"
rm -rf $NCPATH
tar -xjf "$HTML/$STABLEVERSION.tar.bz2" -C "$HTML"
rm "$HTML/$STABLEVERSION.tar.bz2"
cp -R $BACKUP/config "$NCPATH"/
bash $SECURE & spinner_loading
occ_command maintenance:mode --off
occ_command upgrade
# Optimize
print_text_in_color "$ICyan" "Optimizing Nextcloud..."
yes | occ_command db:convert-filecache-bigint
occ_command db:add-missing-indices
else
msg_box "Something went wrong with backing up your old nextcloud instance
Please check in $BACKUP if the folders exist."
exit 1
fi
# Update Bitwarden
if [ "$(docker ps -a >/dev/null 2>&1 && echo yes || echo no)" == "yes" ]
then
if docker ps -a --format '{{.Names}}' | grep -Eq "bitwarden";
then
if is_this_installed apache2
then
if [ -d /root/bwdata ]
then
curl_to_dir "https://raw.githubusercontent.com/bitwarden/server/master/scripts" "bitwarden.sh" "/root"
if [ -f /root/bitwarden.sh ]
then
print_text_in_color "$IGreen" "Upgrading Bitwarden..."
sleep 2
bash /root/bitwarden.sh updateself
bash /root/bitwarden.sh update
fi
fi
fi
fi
fi
# Start Apache2
start_if_stopped apache2
# Recover apps that exists in the backed up apps folder
run_static_script recover_apps
# Enable Apps
if [ -d "$SNAPDIR" ]
then
run_app_script spreedme
fi
# Remove header for Nextcloud 14 (already in .htaccess)
if [ -f /etc/apache2/sites-available/"$(hostname -f)".conf ]
then
if grep -q 'Header always set Referrer-Policy' /etc/apache2/sites-available/"$(hostname -f)".conf
then
sed -i '/Header always set Referrer-Policy/d' /etc/apache2/sites-available/"$(hostname -f)".conf
restart_webserver
fi
fi
# Change owner of $BACKUP folder to root
chown -R root:root "$BACKUP"
# Pretty URLs
print_text_in_color "$ICyan" "Setting RewriteBase to \"/\" in config.php..."
chown -R www-data:www-data "$NCPATH"
occ_command config:system:set htaccess.RewriteBase --value="/"
occ_command maintenance:update:htaccess
bash "$SECURE"
# Repair
occ_command maintenance:repair
# Create $VMLOGS dir
if [ ! -d "$VMLOGS" ]
then
mkdir -p "$VMLOGS"
fi
CURRENTVERSION_after=$(occ_command status | grep "versionstring" | awk '{print $3}')
if [[ "$NCVERSION" == "$CURRENTVERSION_after" ]]
then
msg_box "Latest version is: $NCVERSION. Current version is: $CURRENTVERSION_after.
||| UPGRADE SUCCESS! |||
If you notice that some apps are disabled it's due to that they are not compatible with the new Nextcloud version.
To recover your old apps, please check $BACKUP/apps and copy them to $NCPATH/apps manually.
Thank you for using T&M Hansson IT's updater!"
occ_command status
occ_command maintenance:mode --off
echo "NEXTCLOUD UPDATE success-$(date +"%Y%m%d")" >> "$VMLOGS"/update_run.log
exit 0
else
msg_box "Latest version is: $NCVERSION. Current version is: $CURRENTVERSION_after.
||| UPGRADE FAILED! |||
Your files are still backed up at $BACKUP. No worries!
Please report this issue to $ISSUES
Maintenance mode is kept on."
occ_command status
exit 1
fi