Skip to content

Instantly share code, notes, and snippets.

@rwenz3l
Last active November 23, 2016 00:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwenz3l/54fed884a6941a0844189a004028bf79 to your computer and use it in GitHub Desktop.
Save rwenz3l/54fed884a6941a0844189a004028bf79 to your computer and use it in GitHub Desktop.
Maintenance Script for ACD
echo "(===== Checks =====)"
if [[ -d "/share/acd-raw/plexcrypt" ]];
then
echo "Properly Mounted";
else
echo "Crashed";
echo "(===== Unmount =====)"
echo "Unmount EncFS ACD"
fusermount -z -u /share/acd-dec
echo "Unmount ACD"
fusermount -z -u /share/acd-raw
sleep 2
echo "(===== Mount ACD =====)"
echo "--> Clear Cache"
# possible error here: when the db is corrupt cc fails
acdcli cc
echo "--> Sync"
acdcli sync
echo "--> Mount"
/usr/local/bin/acdcli mount -ao /share/acd-raw
echo "(===== Mount EncFS =====)"
ENCFS6_CONFIG='/opt/encfs/encfs.xml' encfs /share/acd-raw/plexcrypt /share/acd-dec --stdinpass < ~/.enc
# echo "Mount UnionFS Plex"
# unionfs-fuse -o cow -o allow_other -o umask=000 /share/loc-raw=RW:/share/acd-dec=RO /mnt/plex/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment