|
@ -2,13 +2,18 @@ export TMPDIR=${TMPDIR:-/tmp} |
|
|
|
|
|
|
|
|
load_config() { |
|
|
load_config() { |
|
|
local config_path=$TMPDIR/rclone_config |
|
|
local config_path=$TMPDIR/rclone_config |
|
|
|
|
|
local rclone_config_path=/opt/rclone/config |
|
|
|
|
|
local rclone_config_file=$rclone_config_path/.rclone.conf |
|
|
|
|
|
|
|
|
(jq -r '.source.config // empty' < $1) > $config_path |
|
|
(jq -r '.source.config // empty' < $1) > $config_path |
|
|
|
|
|
|
|
|
if [ -s $config_path ]; then |
|
|
if [ -s $config_path ]; then |
|
|
mkdir -p /opt/rclone/config |
|
|
|
|
|
mv $config_path > /opt/rclone/config/.rclone.conf |
|
|
|
|
|
chmod 500 /opt/rclone/config/.rclone.conf |
|
|
|
|
|
|
|
|
mkdir -p $rclone_config_path |
|
|
|
|
|
mv $config_path $rclone_config_file |
|
|
|
|
|
# TODO: Remove Me - DEBUGGING |
|
|
|
|
|
echo "Config file:" |
|
|
|
|
|
cat $rclone_config_file |
|
|
|
|
|
chmod 500 $rclone_config_file |
|
|
else |
|
|
else |
|
|
echo "No config provided" |
|
|
echo "No config provided" |
|
|
exit 1 |
|
|
exit 1 |
|
|