From 7376a02a2c10e0f7bab398c23d559e1130670399 Mon Sep 17 00:00:00 2001 From: Mads Lundt Date: Wed, 17 Jan 2018 10:59:15 +0100 Subject: [PATCH] Create remount --- setup/remount | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 setup/remount diff --git a/setup/remount b/setup/remount new file mode 100644 index 0000000..2bb1dbd --- /dev/null +++ b/setup/remount @@ -0,0 +1,16 @@ +#!/bin/bash +. "/usr/bin/config" + +if [ -z "$(ls -A ${cloud_decrypt_dir})" ] || [ $(ps -ef | grep "unionfs" | grep -v "grep" | wc -l) == "0" ]; then + echo "[ $(date ${date_format}) ] Mount has dropped. Remount in progress." + echo "[ $(date ${date_format}) ] Unmounting..." + fusermount -uz "${cloud_encrypt_dir}" + fusermount -uz "${cloud_decrypt_dir}" + fusermount -uz "${local_decrypt_dir}" + fusermount -uz "${local_media_dir}" + + echo "[ $(date ${date_format}) ] Unmounted successfully" + echo "[ $(date ${date_format}) ] Mounting..." + exec mount + echo "[ $(date ${date_format}) ] Mounted successfully" +fi