This commit is contained in:
2018-11-27 12:39:19 +01:00
parent bb7303874c
commit acf970cd09
5 changed files with 31 additions and 17 deletions

View File

@@ -1,16 +1,15 @@
#!/usr/bin/with-contenv bash
while [ ! -f "/mnt/G-Cache/Video/gocryptfs.conf" ]
while [ ! -f "/encrypted/Video/gocryptfs.conf" ]
do
echo "Waiting for gocryptfs.conf to appear..."
sleep 1
done
mkdir -pv /mnt/Video /crypt/output /crypt/input /Video
mkdir -pv /Video
chmod 777 /Video
s6-setuidgid plex gocryptfs -passfile /config/enc-pwd /encrypted/Video/ /Video
gocryptfs -passfile /root/enc-pwd /mnt/G-Cache/Video/ /mnt/Video
cp /mnt/G-Cache/Video/gocryptfs.conf /crypt/output
gocryptfs -passfile /root/enc-pwd /crypt/output /crypt/input
unionfs -o cow /crypt/input=RW:/mnt/Video=RO /Video
until false
do

View File

@@ -1,6 +1,6 @@
#!/usr/bin/with-contenv bash
while [ ! -f "/root/.plexdrive/config.json" ] || [ ! -f "/root/.plexdrive/token.json" ]
while [ ! -f "/config/config.json" ] || [ ! -f "/config/token.json" ]
do
echo "Waiting for plexdrive configuration files ..."
sleep 30
@@ -10,11 +10,10 @@ umask 022
IFS=" " read -r -a RUN_ARRAY <<< "$RUN_OPTS"
#mount_command="plexdrive mount -c /config/ --cache-file=/cache/cache.bolt -v 3 --umask=0777 --chunk-size=100M --uid=$PUID --gid=$PGID -o allow_other /encrypted ${RUN_ARRAY[@]}"
plexdrive mount -c /root/.plexdrive/ --cache-file=/cache/cache.bolt -v 3 --umask=0777 --chunk-size=100M -o allow_other /mnt/G-Cache ${RUN_ARRAY[@]}
mount_command="plexdrive mount -c /config/ --cache-file=/cache/cache.bolt -v 3 --umask=0777 --chunk-size=100M --uid=$PLEX_UID --gid=$PLEX_GID -o allow_other /encrypted ${RUN_ARRAY[@]}"
#echo "Executing => $mount_command"
#mkdir /encrypted /decrypted
#chmod 777 /encrypted /decrypted
#exec \
s6-setuidgid abc $mount_command
echo "Executing => $mount_command"
mkdir /encrypted /decrypted
chmod 777 /encrypted /decrypted
exec \
s6-setuidgid plex $mount_command