diff --git a/ehdd/shutdown.sh b/ehdd/shutdown.sh index ad593289..0c04f3d5 100755 --- a/ehdd/shutdown.sh +++ b/ehdd/shutdown.sh @@ -9,6 +9,15 @@ if [ -s /etc/mailinabox.conf ]; then #systemctl stop nsd [ -x /usr/sbin/slapd ] && systemctl stop slapd systemctl stop fail2ban + systemctl stop miabldap-capture fi ehdd/umount.sh +code=$? +if [ $code -eq 2 ]; then + echo "Trying again in 10 seconds..." + sleep 10 + ehdd/umount.sh + code=$? +fi +exit $code diff --git a/ehdd/umount.sh b/ehdd/umount.sh index f12cef37..ed11b62a 100755 --- a/ehdd/umount.sh +++ b/ehdd/umount.sh @@ -6,6 +6,6 @@ if ! mount | grep "$EHDD_MOUNTPOINT" >/dev/null; then # not mounted exit 0 fi -umount "$EHDD_MOUNTPOINT" || exit 1 +umount "$EHDD_MOUNTPOINT" || exit 2 cryptsetup luksClose $EHDD_LUKS_NAME losetup -d $(find_inuse_loop)