commit
c69eb3c2db
2 changed files with 20 additions and 2 deletions
14
README.md
14
README.md
|
@ -102,6 +102,8 @@ Specification of rclone parameters on a per remote basis can be created inside h
|
||||||
|
|
||||||
PROFILE=0
|
PROFILE=0
|
||||||
|
|
||||||
|
SUBPATH= ( root directory of share )
|
||||||
|
|
||||||
**NOTE:** _The above are defaults for all remotes without `.*.param` files containing opposing values.
|
**NOTE:** _The above are defaults for all remotes without `.*.param` files containing opposing values.
|
||||||
|
|
||||||
- Custom remote params example #1
|
- Custom remote params example #1
|
||||||
|
@ -118,6 +120,18 @@ Specification of rclone parameters on a per remote basis can be created inside h
|
||||||
|
|
||||||
**NOTE:** _There is no need to specify values you do not wish to change. Ensure a line break/carriage return exist after each specified param or they will not be parsed. For more information see [issue #2](https://github.com/Magisk-Modules-Repo/com.piyushgarg.rclone/issues/2)_
|
**NOTE:** _There is no need to specify values you do not wish to change. Ensure a line break/carriage return exist after each specified param or they will not be parsed. For more information see [issue #2](https://github.com/Magisk-Modules-Repo/com.piyushgarg.rclone/issues/2)_
|
||||||
|
|
||||||
|
- Custom remote params example #2 (using SUBPATH)
|
||||||
|
|
||||||
|
_The following configuration will mount the remote subdirectory `Batman` as the root directory of the share `[Movies]`._
|
||||||
|
|
||||||
|
/sdcard/.rclone/.Movies.param
|
||||||
|
|
||||||
|
1| SDBINDPOINT=BatmanMovie
|
||||||
|
2| SUBPATH=Batman
|
||||||
|
3|
|
||||||
|
|
||||||
|
Now the mounted directory `/sdcard/BatmanMovie` is actually the remote directory `Movies/Batman`.
|
||||||
|
|
||||||
---
|
---
|
||||||
## Custom Globals
|
## Custom Globals
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ custom_params () {
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
PARAMS="DISABLE LOGFILE LOGLEVEL CACHEMODE CHUNKSIZE CHUNKTOTAL CACHEWORKERS CACHEINFOAGE DIRCACHETIME ATTRTIMEOUT BUFFERSIZE READAHEAD M_UID M_GID DIRPERMS FILEPERMS READONLY BINDSD SDBINDPOINT ADD_PARAMS REPLACE_PARAMS PROFILE ISOLATE SDSYNCDIRS SYNC_WIFI SYNC_BATTLVL SYNC_CHARGE"
|
PARAMS="DISABLE LOGFILE LOGLEVEL CACHEMODE CHUNKSIZE CHUNKTOTAL CACHEWORKERS CACHEINFOAGE DIRCACHETIME ATTRTIMEOUT BUFFERSIZE READAHEAD M_UID M_GID DIRPERMS FILEPERMS READONLY BINDSD SDBINDPOINT ADD_PARAMS REPLACE_PARAMS PROFILE ISOLATE SDSYNCDIRS SYNC_WIFI SYNC_BATTLVL SYNC_CHARGE SUBPATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BAD_SYNTAX="(^\s*#|^\s*$|^\s*[a-z_][^[:space:]]*=[^;&\(\`]*$)"
|
BAD_SYNTAX="(^\s*#|^\s*$|^\s*[a-z_][^[:space:]]*=[^;&\(\`]*$)"
|
||||||
|
@ -140,6 +140,7 @@ custom_params () {
|
||||||
|
|
||||||
echo "loading .${remote}.param"
|
echo "loading .${remote}.param"
|
||||||
|
|
||||||
|
# FIX: Unnecessary and very inefficient double loop
|
||||||
for PARAM in ${PARAMS[@]}; do
|
for PARAM in ${PARAMS[@]}; do
|
||||||
|
|
||||||
while read -r VAR; do
|
while read -r VAR; do
|
||||||
|
@ -150,6 +151,8 @@ custom_params () {
|
||||||
|
|
||||||
VALUE=\"${VALUE}\"
|
VALUE=\"${VALUE}\"
|
||||||
|
|
||||||
|
# Unnecessary echo in a subshell execution below? Why not just:
|
||||||
|
# eval "${PARAM}""=""${VALUE}"
|
||||||
eval $(echo "${PARAM}""=""${VALUE}")
|
eval $(echo "${PARAM}""=""${VALUE}")
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -353,6 +356,7 @@ reset_params () {
|
||||||
unset SYNCDIR
|
unset SYNCDIR
|
||||||
unset SDSYNCDIRS
|
unset SDSYNCDIRS
|
||||||
unset PIDFILE
|
unset PIDFILE
|
||||||
|
unset SUBPATH
|
||||||
LOGFILE=${USER_CONFDIR}/rclone.log
|
LOGFILE=${USER_CONFDIR}/rclone.log
|
||||||
LOGLEVEL=NOTICE
|
LOGLEVEL=NOTICE
|
||||||
CACHEMODE=off
|
CACHEMODE=off
|
||||||
|
@ -426,7 +430,7 @@ rclone_mount () {
|
||||||
|
|
||||||
mkdir -p ${CLOUDROOTMOUNTPOINT}/${remote}
|
mkdir -p ${CLOUDROOTMOUNTPOINT}/${remote}
|
||||||
|
|
||||||
su -M -p -c nice -n 19 ionice -c 2 -n 7 ${HOME}/rclone mount ${remote}: ${CLOUDROOTMOUNTPOINT}/${remote} --config ${CONFIGFILE} ${RCLONE_PARAMS} --daemon >> /dev/null 2>&1 &
|
su -M -p -c nice -n 19 ionice -c 2 -n 7 ${HOME}/rclone mount "${remote}:${SUBPATH}" ${CLOUDROOTMOUNTPOINT}/${remote} --config ${CONFIGFILE} ${RCLONE_PARAMS} --daemon >> /dev/null 2>&1 &
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue