Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2022-11-02 07:44:13 +0300
committerGitHub <noreply@github.com>2022-11-02 07:44:13 +0300
commit2d4822564dea2548b24198b91434d2476384c462 (patch)
tree6e47eefa2363616aaa87b37c3ec8e4eb4161787a
parentfd3810b7c941e6aecdb39af0792413431b984d34 (diff)
a few veracrypt enhancements (#2389)
* a few veracrypt enhancements Signed-off-by: szaimen <szaimen@e.mail.de> * Don't update existing installs as it is to risky Signed-off-by: szaimen <szaimen@e.mail.de> Signed-off-by: szaimen <szaimen@e.mail.de> Co-authored-by: Daniel Hansson <mailto@danielhansson.nu>
-rw-r--r--not-supported/restore-backup.sh2
-rw-r--r--not-supported/veracrypt-btrfs.sh15
-rw-r--r--not-supported/veracrypt-ntfs.sh16
3 files changed, 17 insertions, 16 deletions
diff --git a/not-supported/restore-backup.sh b/not-supported/restore-backup.sh
index 8b244f40..7492c905 100644
--- a/not-supported/restore-backup.sh
+++ b/not-supported/restore-backup.sh
@@ -591,7 +591,7 @@ Before=network.target
[Service]
Type=forking
-ExecStart=/bin/bash $SCRIPTS/veracrypt-automount.sh
+ExecStart=-/bin/bash $SCRIPTS/veracrypt-automount.sh
TimeoutStopSec=1
[Install]
diff --git a/not-supported/veracrypt-btrfs.sh b/not-supported/veracrypt-btrfs.sh
index 01ca9c8a..f006a195 100644
--- a/not-supported/veracrypt-btrfs.sh
+++ b/not-supported/veracrypt-btrfs.sh
@@ -209,6 +209,9 @@ then
chown root:root "$SCRIPTS/veracrypt-automount.sh"
chmod 700 "$SCRIPTS/veracrypt-automount.sh"
+# Reset maintenance mode to disabled upon restart
+sed -i "/'maintenance'/s/true/false/" "$NCPATH/config/config.php"
+
# Veracrypt entries
AUTOMOUNT
fi
@@ -259,7 +262,7 @@ else
fi
send_mail "One veracrypt drive is not connected anymore!" "Please connect the drive and reboot your server!
The maintenance mode was activated to prevent any issue with Nextcloud.
-You can disable it after the drive is successfully mounted again!"
+A reboot should fix the issue if the drive is successfully connected again."
CONNECTED
# Secure the file
@@ -297,9 +300,7 @@ crontab -u root -l | { cat; echo "@reboot $SCRIPTS/adjust-startup-permissions.sh
# Delete crontab
crontab -u root -l | grep -v 'veracrypt-automount.sh' | crontab -u root -
# Create service instead
-if ! [ -f /etc/systemd/system/veracrypt-automount.service ]
-then
- cat << SERVICE > /etc/systemd/system/veracrypt-automount.service
+cat << SERVICE > /etc/systemd/system/veracrypt-automount.service
[Unit]
Description=Mount Veracrypt Devices
After=boot.mount
@@ -307,14 +308,14 @@ Before=network.target
[Service]
Type=forking
-ExecStart=/bin/bash $SCRIPTS/veracrypt-automount.sh
+ExecStart=-/bin/bash $SCRIPTS/veracrypt-automount.sh
TimeoutStopSec=1
[Install]
WantedBy=multi-user.target
SERVICE
- systemctl enable veracrypt-automount
-fi
+systemctl disable veracrypt-automount &>/dev/null
+systemctl enable veracrypt-automount
# Adjust permissions
print_text_in_color "$ICyan" "Adjusting permissions..."
diff --git a/not-supported/veracrypt-ntfs.sh b/not-supported/veracrypt-ntfs.sh
index 1cfe031b..fc65ac4d 100644
--- a/not-supported/veracrypt-ntfs.sh
+++ b/not-supported/veracrypt-ntfs.sh
@@ -210,6 +210,9 @@ then
chown root:root "$SCRIPTS/veracrypt-automount.sh"
chmod 700 "$SCRIPTS/veracrypt-automount.sh"
+# Reset maintenance mode to disabled upon restart
+sed -i "/'maintenance'/s/true/false/" "$NCPATH/config/config.php"
+
# Veracrypt entries
AUTOMOUNT
fi
@@ -225,7 +228,7 @@ then
nextcloud_occ_no_check maintenance:mode --on
send_mail "$MOUNT_PATH could not get mounted!" "Please connect the drive and reboot your server! \
The maintenance mode was activated to prevent any issue with Nextcloud. \
-You can disable it after the drive is successfully mounted again!"
+A reboot should fix the issue if the drive is successfully connected again."
fi
AUTOMOUNT
@@ -275,9 +278,7 @@ nohup bash "$SCRIPTS/is-drive-connected.sh" "$PARTUUID" &>/dev/null &
# Delete crontab
crontab -u root -l | grep -v 'veracrypt-automount.sh' | crontab -u root -
# Create service instead
-if ! [ -f /etc/systemd/system/veracrypt-automount.service ]
-then
- cat << SERVICE > /etc/systemd/system/veracrypt-automount.service
+cat << SERVICE > /etc/systemd/system/veracrypt-automount.service
[Unit]
Description=Mount Veracrypt Devices
After=boot.mount
@@ -285,15 +286,14 @@ Before=network.target
[Service]
Type=forking
-ExecStart=/bin/bash $SCRIPTS/veracrypt-automount.sh
+ExecStart=-/bin/bash $SCRIPTS/veracrypt-automount.sh
TimeoutStopSec=1
[Install]
WantedBy=multi-user.target
SERVICE
- systemctl enable veracrypt-automount
-fi
-
+systemctl disable veracrypt-automount &>/dev/null
+systemctl enable veracrypt-automount
# Inform the user
msg_box "Congratulations! The mount was successful.