+function DisableMaintenanceMode() {
+ echo "Switching off maintenance mode..."
+ sudo -u "${webserverUser}" php ${nextcloudFileDir}/occ maintenance:mode --off
+ echo "Done"
+ echo
+}
+
+# Capture CTRL+C
+trap CtrlC INT
+
+function CtrlC() {
+ read -p "Backup cancelled. Keep maintenance mode? [y/n] " -n 1 -r
+ echo
+
+ if ! [[ $REPLY =~ ^[Yy]$ ]]
+ then
+ DisableMaintenanceMode
+ else
+ echo "Maintenance mode still enabled."
+ fi
+
+ exit 1
+}
+