From 16c0686c4cfa1cf9b55f9ba6930c4157f9b3934b Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Mon, 19 Feb 2024 08:23:31 -0800 Subject: [PATCH] added fix for nextcloud 28.0.2 --- ...n_SystemsOS_File_Fixes_And_New_Services.sh | 9 +++ .../nextcloud_maintenance_window_fix.sh | 62 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 file_fixes_and_new_services/nextcloud_maintenance_window_fix.sh diff --git a/file_fixes_and_new_services/Sovran_SystemsOS_File_Fixes_And_New_Services.sh b/file_fixes_and_new_services/Sovran_SystemsOS_File_Fixes_And_New_Services.sh index 61b42cc..c6ac7b9 100755 --- a/file_fixes_and_new_services/Sovran_SystemsOS_File_Fixes_And_New_Services.sh +++ b/file_fixes_and_new_services/Sovran_SystemsOS_File_Fixes_And_New_Services.sh @@ -32,6 +32,15 @@ rm -rf /home/free/Downloads/add-custom-nix.sh rm -rf /home/free/Downloads/sovran-pro-flake-update2.sh +#### SCRIPT 4 #### + +/run/current-system/sw/bin/wget "https://git.sovransystems.com/Sovran_Systems/Sovran_SystemsOS/raw/branch/main/file_fixes_and_new_services/nextcloud_maintenance_window_fix.sh" + +/run/current-system/sw/bin/bash /home/free/Downloads/nextcloud_maintenance_window_fix.sh + +rm -rf /home/free/Downloads/nextcloud_maintenance_window_fix.sh + + #### REMOVAL OF MAIN SCRIPT #### rm -rf /home/free/Downloads/Sovran_SystemsOS_File_Fixes_And_New_Services.sh \ No newline at end of file diff --git a/file_fixes_and_new_services/nextcloud_maintenance_window_fix.sh b/file_fixes_and_new_services/nextcloud_maintenance_window_fix.sh new file mode 100644 index 0000000..2f52041 --- /dev/null +++ b/file_fixes_and_new_services/nextcloud_maintenance_window_fix.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +function log_console () { + echo "`date` :: $1" >> /var/lib/beacons/awesome.log + echo $1 +} + + +#### CHECK TO SEE IF IT HAS BEEN RUN BEFORE #### + +FILE=/var/lib/beacons/file_fixes_and_new_services/nextcloud_maintenance_window_fix/completed + + if [ -e $FILE ]; then + + /run/current-system/sw/bin/echo "File Found :), No Need to Run ... Exiting" + + exit 1 + + fi + + +#### CREATE INITIAL TAG #### + +/run/current-system/sw/bin/mkdir -p /var/lib/beacons/file_fixes_and_new_services/nextcloud_maintenance_window_fix ; touch /var/lib/beacons/file_fixes_and_new_services/nextcloud_maintenance_window_fix/started + + if [[ $? != 0 ]]; then + + /run/current-system/sw/bin/echo "Could Not Create Initial Tag" + + exit 1 + + fi + + +#### MAIN SCRIPT #### + +sudo -u caddy php /var/lib/www/nextcloud/occ config:system:set maintenance_window_start --type=integer --value=1 + + if [[ $? != 0 ]]; then + + /run/current-system/sw/bin/echo "Could Not Run add-custom-nix" + + exit 1 + + fi + + + +#### CREATE COMPELETE TAG #### + +/run/current-system/sw/bin/touch /var/lib/beacons/file_fixes_and_new_services/nextcloud_maintenance_window_fix/completed + + if [[ $? != 0 ]]; then + + /run/current-system/sw/bin/echo "Could Not Create Completed Tag" + + exit 1 + + fi + + +exit 0 \ No newline at end of file