Skip to content

Commit

Permalink
Create remount
Browse files Browse the repository at this point in the history
  • Loading branch information
madslundt authored Jan 17, 2018
1 parent 85ab1f9 commit 7376a02
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions setup/remount
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7376a02

Please sign in to comment.