Skip to content

Commit

Permalink
chore: variable config path
Browse files Browse the repository at this point in the history
  • Loading branch information
Lustyn committed May 1, 2022
1 parent 1244cee commit 83423bc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions root/etc/cont-init.d/50-magicdrive
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

echo "*** checking plexdrive config"
while [ ! -f "${pd_config}" ] || [ ! -f "${pd_token}" ]; do
echo "Waiting for plexdrive config files in /config. Retrying in 30s ..."
echo "Waiting for plexdrive config files in ${config_dir}. Retrying in 30s ..."
echo "RUN: docker exec -it <CONTAINER_NAME> plexdrive_setup"
sleep 30
done

echo "*** checking rclone config"
while [ ! -f "${rclone_config}" ]; do
echo "Waiting for rclone config file in /config/rclone.conf. Retrying in 30s ..."
echo "Waiting for rclone config file in ${rclone_config}. Retrying in 30s ..."
echo "RUN: docker exec -it <CONTAINER_NAME> rclone_setup"
sleep 30
done
Expand All @@ -31,7 +31,7 @@ check_mountpoint "${pd_mountpoint}"

# permissions
chown -R abc:abc \
/config /cache ${pd_mountpoint} ${rclone_mountpoint} ${mfs_mountpoint}
${config_dir} ${pd_mountpoint} ${rclone_mountpoint} ${mfs_mountpoint} /cache
chown abc:abc /local

# display version
Expand Down
2 changes: 1 addition & 1 deletion root/usr/local/bin/plexdrive_setup
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Setup Plexdrive

if [ -f "${pd_config}" ] || [ -f "${pd_token}" ]; then
echo "Plexdrive has already been set up."
echo "Try again after removing both 'config.json' and 'token.json' in /config."
echo "Try again after removing both ${pd_config} and ${pd_token}."
else
plexdrive mount $pd_mountpoint $(echo $pd_basic_opts)
fi
2 changes: 1 addition & 1 deletion root/usr/local/bin/rclone_setup
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Setup Rclone

if [ -f "${rclone_config}" ]; then
echo "Rclone has already been set up."
echo "Try again after removing 'rclone.conf' in /config."
echo "Try again after removing ${rclone_config}."
else
read -e -i "${rclone_mountpoint}" -p "Path to encrypted files (press enter if you don't need a subpath): " remote
rclone config create --all --config "${rclone_config}" "${rclone_remote}" crypt "remote=${remote}"
Expand Down
10 changes: 6 additions & 4 deletions root/usr/local/bin/variables
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ waitmount() {
done
}

pd_config="/config/config.json"
pd_token="/config/token.json"
config_dir="/config"

pd_config="${config_dir}/config.json"
pd_token="${config_dir}/token.json"
pd_mountpoint="/enc"
pd_basic_opts="
-v 2
--config /config/
--config ${config_dir}/
--uid=${PUID:-911}
--gid=${PGID:-911}
--umask=0100775
-o allow_other,direct_io
"

rclone_config="/config/rclone.conf"
rclone_config="${config_dir}/rclone.conf"
rclone_remote="dec:"
rclone_mountpoint="/dec"
rclone_basic_opts="
Expand Down

0 comments on commit 83423bc

Please sign in to comment.