#!/usr/bin/with-contenv bash mkdir /encrypted rm -Rf ~/.cache rclone mount --daemon --allow-other --vfs-cache-mode minimal --no-modtime --write-back-cache gcache:/ /encrypted --log-file /tmp/rclone.log --log-level DEBUG while [ ! -f "/encrypted/gocryptfs.conf" ] do echo "Waiting for gocryptfs.conf to appear..." sleep 1 done mkdir -pv /Video chmod 777 /Video s6-setuidgid plex gocryptfs -passfile /etc/plexdrv/enc-pwd /encrypted/ /Video until false do true sleep 1 done