├── META-INF └── com │ └── google │ └── android │ ├── updater-script │ └── update-binary ├── common ├── binary │ ├── arm │ │ ├── fusermount │ │ ├── inotifywait │ │ └── rclone │ ├── x64 │ │ ├── fusermount │ │ ├── inotifywait │ │ └── rclone │ ├── x86 │ │ ├── fusermount │ │ ├── inotifywait │ │ └── rclone │ └── arm64 │ │ ├── fusermount │ │ ├── inotifywait │ │ └── rclone └── lib │ ├── arm │ └── libandroid-support.so │ ├── arm64 │ └── libandroid-support.so │ ├── x64 │ └── libandroid-support.so │ └── x86 │ └── libandroid-support.so ├── uninstall.sh ├── module.prop ├── .gitattributes ├── syncd.sh ├── customize.sh ├── CHANGELOG.md ├── system └── bin │ └── rclone ├── README.md └── service.sh /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /common/binary/arm/fusermount: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/binary/arm/fusermount -------------------------------------------------------------------------------- /common/binary/x64/fusermount: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/binary/x64/fusermount -------------------------------------------------------------------------------- /common/binary/x86/fusermount: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/binary/x86/fusermount -------------------------------------------------------------------------------- /common/binary/arm/inotifywait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/binary/arm/inotifywait -------------------------------------------------------------------------------- /common/binary/arm64/fusermount: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/binary/arm64/fusermount -------------------------------------------------------------------------------- /common/binary/x64/inotifywait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/binary/x64/inotifywait -------------------------------------------------------------------------------- /common/binary/x86/inotifywait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/binary/x86/inotifywait -------------------------------------------------------------------------------- /common/binary/arm64/inotifywait: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/binary/arm64/inotifywait -------------------------------------------------------------------------------- /common/lib/arm/libandroid-support.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/lib/arm/libandroid-support.so -------------------------------------------------------------------------------- /common/lib/arm64/libandroid-support.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/lib/arm64/libandroid-support.so -------------------------------------------------------------------------------- /common/lib/x64/libandroid-support.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/lib/x64/libandroid-support.so -------------------------------------------------------------------------------- /common/lib/x86/libandroid-support.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rabbits-heart/rclone_RD-MagiskModule/HEAD/common/lib/x86/libandroid-support.so -------------------------------------------------------------------------------- /common/binary/arm/rclone: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ce562429dd94a8d4a5fea94109a8e8572695b48abaf72969de0917ab8599c216 3 | size 106099540 4 | -------------------------------------------------------------------------------- /common/binary/arm64/rclone: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c1494a601aed77665b060cdae75c35babc66eebec0d6c40bda06c20f3921d086 3 | size 125461480 4 | -------------------------------------------------------------------------------- /common/binary/x64/rclone: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c21768f7c6097959a496e1de77de9b4db7a6b1889ef688091a288906d969c3cb 3 | size 126004152 4 | -------------------------------------------------------------------------------- /common/binary/x86/rclone: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bdaed22a43eb152683ac91231c771b2efb8da2b1d850f681bac08b20cda63529 3 | size 107689328 4 | -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | MODDIR=${0%/*} 2 | 3 | CONFIGFILE=/sdcard/Android/.rclone/rclone.conf 4 | CLOUDROOTMOUNTPOINT=/mnt/cloud/ 5 | 6 | "$MODDIR"/rclone listremotes --config ${CONFIGFILE}|cut -f1 -d: | 7 | while read -r line; do 8 | umount -f ${CLOUDROOTMOUNTPOINT}/"$line" 9 | sleep 1 10 | done 11 | 12 | rm -f ${CONFIGFILE:?} 13 | rm -rf ${CLOUDROOTMOUNTPOINT:?} 14 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=rclone_RD-MagiskModule 2 | name=rclone_RD Magisk Module (forked from rclone-mount-magisk) 3 | version=rclone: (v1.60.1) mod: (v1.3.1) 4 | versionCode=117 5 | author=rabbits-heart (OG: Howard20181 and AvinashReddy3108 and piyushgarg) 6 | description=RealDebrid-compatible magisk module to mount and sync your cloud storage on your device using 'rclone' & 'fusermount', providing virtually limitless storage expansion with support for dozens of cloud providers and extensive customization options. 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto eol=lf 3 | # Declare files that will always have CRLF line endings on checkout. 4 | *.cmd text eol=crlf 5 | *.bat text eol=crlf 6 | # Denote all files that are truly binary and should not be modified. 7 | *.so binary 8 | *.dex binary 9 | *.jar binary 10 | *.png binary 11 | common/binary/** binary 12 | /common/binary/x86/rclone filter=lfs diff=lfs merge=lfs -text 13 | /common/binary/x64/rclone filter=lfs diff=lfs merge=lfs -text 14 | /common/binary/arm/rclone filter=lfs diff=lfs merge=lfs -text 15 | /common/binary/arm64/rclone filter=lfs diff=lfs merge=lfs -text 16 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ################# 4 | # Initialization 5 | ################# 6 | 7 | umask 022 8 | 9 | # echo before loading util_functions 10 | ui_print() { echo "$1"; } 11 | 12 | require_new_magisk() { 13 | ui_print "*******************************" 14 | ui_print " Please install Magisk v20.4+! " 15 | ui_print "*******************************" 16 | exit 1 17 | } 18 | 19 | ######################### 20 | # Load util_functions.sh 21 | ######################### 22 | 23 | OUTFD=$2 24 | ZIPFILE=$3 25 | 26 | mount /data 2>/dev/null 27 | 28 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 29 | . /data/adb/magisk/util_functions.sh 30 | [ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk 31 | 32 | install_module 33 | exit 0 -------------------------------------------------------------------------------- /syncd.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | MODDIR=${0%/*} 4 | TMPDIR=${MODDIR}/.tmp 5 | SYNC_PENDING=$TMPDIR/$remote.sync.pend 6 | 7 | dump_battery() { 8 | BATTERY_DUMP="$(dumpsys battery)" 9 | } 10 | 11 | battery_level() { 12 | echo "$BATTERY_DUMP" | grep level | cut -d ':' -f2 | cut -d ' ' -f2 13 | } 14 | 15 | ac_charge() { 16 | echo "$BATTERY_DUMP" | grep -w "AC powered" | cut -d ":" -f2 | cut -d " " -f2 17 | } 18 | 19 | usb_charge() { 20 | echo "$BATTERY_DUMP" | grep -w "USB powered" | cut -d ":" -f2 | cut -d " " -f2 21 | } 22 | 23 | echo $$ >>"$PIDFILE" 24 | 25 | while true; do 26 | if [ ! -f "$SYNC_PENDING" ]; then 27 | inotifywait "/storage/emulated/$PROFILE/$SYNCDIR" -e modify,create,moved_to,close_write -q >>/dev/null 2>&1 && touch "$SYNC_PENDING" 28 | fi 29 | 30 | while true; do 31 | sleep 5 32 | dump_battery 33 | if [ "$(battery_level)" -gt "$SYNC_BATTLVL" ] || [ "$(bettery_level)" -eq "$SYNC_BATTLVL" ] || [ "$(ac_charge)" = true ] || [ "$(usb_charge)" = true ]; then 34 | echo "Sync battery check success" 35 | else 36 | sleep 300 37 | continue 38 | fi 39 | if [ "$SYNC_CHARGE" = 1 ]; then 40 | if [ "$(ac_charge)" = true ] || [ "$(usb_charge)" = true ]; then 41 | echo "Sync charge check success" 42 | else 43 | echo "Sync charge check fail" 44 | sleep 300 45 | continue 46 | fi 47 | fi 48 | if [ "$SYNC_WIFI" = 1 ]; then 49 | if ! ping -I wlan0 -c 1 "$NETCHK_ADDR" >>/dev/null 2>&1; then 50 | echo "Sync wifi check fail" 51 | sleep 300 52 | continue 53 | else 54 | echo "Sync wifi check success" 55 | fi 56 | fi 57 | break 58 | done 59 | 60 | echo "Syncing..." 61 | nice -n 19 ionice -c 2 -n 7 "$MODDIR"/rclone copy "/storage/emulated/$PROFILE/$SYNCDIR" "$CLOUDROOTMOUNTPOINT/$remote/$SYNCDIR" --retries-sleep=10m --retries 6 --transfers 1 --multi-thread-streams 1 >>/dev/null 2>&1 62 | 63 | if [ -f "$SYNC_PENDING" ]; then 64 | rm -f "${SYNC_PENDING:?}" 65 | fi 66 | echo "Sync finished!" 67 | done 68 | -------------------------------------------------------------------------------- /customize.sh: -------------------------------------------------------------------------------- 1 | # shellcheck disable=SC2034 2 | SKIPUNZIP=1 3 | extract() { 4 | zip=$1 5 | file=$2 6 | dir=$3 7 | junk_paths=$4 8 | [ -z "$junk_paths" ] && junk_paths=false 9 | opts="-o" 10 | [ $junk_paths = true ] && opts="-oj" 11 | 12 | file_path="" 13 | if [ $junk_paths = true ]; then 14 | file_path="$dir/$(basename "$file")" 15 | else 16 | file_path="$dir/$file" 17 | fi 18 | unzip $opts "$zip" "$file" -d "$dir" >&2 19 | [ -f "$file_path" ] || abort "$file not exists" 20 | 21 | ui_print "- Unzip $file" >&1 22 | } 23 | extract "$ZIPFILE" 'module.prop' "$MODPATH" 24 | extract "$ZIPFILE" 'service.sh' "$MODPATH" 25 | extract "$ZIPFILE" 'uninstall.sh' "$MODPATH" 26 | extract "$ZIPFILE" "syncd.sh" "$MODPATH" 27 | mkdir -p "$MODPATH/system/bin" 28 | extract "$ZIPFILE" "common/binary/$ARCH/inotifywait" "$MODPATH/system/bin" true 29 | extract "$ZIPFILE" "system/bin/rclone" "$MODPATH" 30 | extract "$ZIPFILE" "common/binary/$ARCH/rclone" "$MODPATH" true 31 | 32 | if [ "$IS64BIT" = true ]; then 33 | mkdir -p "$MODPATH/system/lib64" 34 | extract "$ZIPFILE" "common/lib/$ARCH/libandroid-support.so" "$MODPATH/system/lib64" true 35 | else 36 | mkdir -p "$MODPATH/system/lib" 37 | extract "$ZIPFILE" "common/lib/$ARCH/libandroid-support.so" "$MODPATH/system/lib" true 38 | fi 39 | 40 | extract "$ZIPFILE" "common/binary/$ARCH/fusermount" "$MODPATH/system/bin" true 41 | 42 | set_perm_recursive "$MODPATH" 0 0 0755 0644 43 | set_perm "$MODPATH"/service.sh 0 0 0755 44 | set_perm "$MODPATH"/syncd.sh 0 0 0755 45 | set_perm "$MODPATH"/rclone 0 0 0755 46 | [ -d "$MODPATH/system/bin" ] && set_perm_recursive "$MODPATH/system/bin" 0 0 0755 0755 47 | [ -d "$MODPATH/system/lib" ] && set_perm_recursive "$MODPATH/system/lib" 0 0 0755 0644 u:object_r:system_lib_file:s0 48 | [ -d "$MODPATH/system/lib64" ] && set_perm_recursive "$MODPATH/system/lib64" 0 0 0755 0644 u:object_r:system_lib_file:s0 49 | USER_CONFDIR_OLD=/sdcard/.rclone 50 | USER_CONFDIR=/sdcard/Android/.rclone 51 | USER_CONF=$USER_CONFDIR/rclone.conf 52 | USER_CONF_OLD=$USER_CONFDIR_OLD/rclone.conf 53 | if [ -f "$USER_CONF" ]; then 54 | ui_print 55 | ui_print "- Please reboot to take effect" 56 | ui_print 57 | elif [ -f "$USER_CONF_OLD" ] && [ ! -d "$USER_CONFDIR" ]; then 58 | ui_print "- Migrating config file to $USER_CONFDIR" 59 | mkdir -p "$USER_CONFDIR" 60 | mv "$USER_CONFDIR_OLD"/* "$USER_CONFDIR"/ 61 | rm -rf "${USER_CONFDIR_OLD:?}" 62 | else 63 | ui_print "'$USER_CONF' not found!" 64 | ui_print 65 | ui_print "Additional setup required..." 66 | ui_print "------------------------------------" 67 | ui_print " Instructions: " 68 | ui_print " - Open Terminal " 69 | ui_print " - Type 'su' & tap enter " 70 | ui_print " - Type 'rclone config' & tap enter " 71 | ui_print " - Follow on screen options. " 72 | ui_print "------------------------------------" 73 | fi 74 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## Changelog (forked) 2 | ### v1.30 3 | * Updated `rclone` to match itsToggle fork https://github.com/itsToggle/rclone_RD/releases 4 | 5 | 6 | ### v1.20 (Howard20 fork) 7 | * Updated `rclone` to 1.60.0 8 | * Updated `inotifywait` to 3.22.6.0 9 | * Fix `rclone config` on Windows Subsystem for Android 10 | * Fix bind-mount to `/sdcard` on Windows Subsystem for Android 11 | ### v1.14 (binary updates) 12 | * Updated rclone to 1.56.0 for all supported architectures. 13 | * Updated README.md to point to Termux packages source. 14 | 15 | ### v1.14 16 | * Used @Zackptg5's MMT-EX module template. 17 | * Cleaned all install & wrapper scripts. 18 | * Fixed bugs related to `rclone` command not working (proper wrapper script placement). 19 | * All the webservers (SFTP/FTP/HTTP) work fine now. 20 | * Bring back x86 and x86_64 support. 21 | * Updated all binaries (extracted from Termux builds). 22 | - `libandroid-support` (28) 23 | - `rclone` (1.55.0) 24 | - `fusermount` (2.9.9) 25 | - `inotifywait` (3.20.11.0) 26 | 27 | ## Changelog (source) 28 | 29 | ### v1.13 30 | * Add arm/arm64 1.53 binaries downloaded from https://beta.rclone.org/v1.53.0/testbuilds/rclone-android-16-arm.gz 31 | 32 | ### v1.12 33 | * Fixed restart problems. 34 | 35 | ### v1.11 36 | * Add arm/arm64 1.52 bins downloaded from https://beta.rclone.org/v1.52.0/testbuilds/rclone-android-16-arm.gz 37 | * Fixed service.sh paths 38 | 39 | ### v1.10 40 | * fixed fusermount wrapper 41 | 42 | ### v1.9 43 | * Add arm/arm64 1.51 bins downloaded from https://beta.rclone.org/ 44 | * Commented fusermount wrapper 45 | 46 | ### v1.8 47 | * Support for Work Profiles `PROFILE=` 48 | * Isolate to Work Profiles `ISOLATE=1` 49 | * Support syncing from SD to remote 50 | 51 | ### v1.7 52 | * Add ability to disable HTTP/FTP 53 | * Link rest of default params to custom vars 54 | * Exclude some custom params from globals 55 | * Make some globals exclusive 56 | * Change `BINDPOINT=` to `SDBINDPOINT=` 57 | * Fix bug with custom params 58 | * Set `PATH=` to change priority of used bins 59 | 60 | ### v1.6 61 | * Simplify custom global parameters 62 | * Fix & improve binding to SD 63 | * Specify additional rclone ops with `ADD_PARAMS=` 64 | * Replace `rclone mount` ops via `REPLACE_PARAMS=` 65 | 66 | ### v1.5 67 | * Replace arm/arm64 `rclone` 1.48 bins built with Termux 68 | * Replace arm/arm64 `fusermount` built with Termux 69 | * Add arm/arm64 `libandroid-support.so` from Termux 70 | * Support for mounting to SD 71 | * Squash missing rclone.conf install bug 72 | * Tune default parameters 73 | * Include a wrap for `rclone config` 74 | * Include `fusermount-wrapper.sh` 75 | * General Improvements 76 | 77 | ### v1.4 78 | * Add ability to disable a remote 79 | * Add a wrapper script for rclone 80 | * Access remotes via http & ftp 81 | * Use without rebooting device 82 | * Add wrapper cmds to `rclone help` 83 | * Make remount possible via `su -M -c` 84 | 85 | ### v1.3 86 | * Move user rclone.conf & related to `/sdcard/.rclone/` 87 | * Control global `--vfs-cache-mode` via simple files placed in `/sdcard/.rclone/` 88 | * Specify custom params for individual remotes via `/sdcard/.rclone/.REMOTENAME.params` 89 | 90 | ### v1.2 91 | * Change install process 92 | * Changes for full systemless 93 | * Improve mount reliability 94 | * Symlink mountpoint to `/storage/` 95 | 96 | ### v1.1 97 | * Initial release 98 | * rclone mount 99 | -------------------------------------------------------------------------------- /system/bin/rclone: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | # Module directory, DO NOT TOUCH THIS! 4 | MODDIR=${MODDIR:-$(magisk --path)/.magisk/modules/rclone.mount} 5 | RCLONE_BIN=${MODDIR}/rclone 6 | echo "Using 'rclone' binary: ${RCLONE_BIN}" 7 | 8 | USER_CONFDIR=/sdcard/Android/.rclone 9 | USER_CONF=${USER_CONFDIR}/rclone.conf 10 | export XDG_CONFIG_HOME=/data/local/tmp/ 11 | CONFIGFILE="$XDG_CONFIG_HOME"/rclone/rclone.conf 12 | export LOGFILE=${USER_CONFDIR}/rclone.log 13 | export LOGLEVEL=NOTICE 14 | export DATA_MEDIA=/data/media/0 15 | RUNTIME_R=/mnt/runtime/read 16 | RUNTIME_W=/mnt/runtime/write 17 | RUNTIME_D=/mnt/runtime/default 18 | BINDPOINT_R=${RUNTIME_R}/emulated/0/Cloud 19 | BINDPOINT_W=${RUNTIME_W}/emulated/0/Cloud 20 | BINDPOINT_D=${RUNTIME_D}/emulated/0/Cloud 21 | SD_BINDPOINT=${BINDPOINT_D} 22 | CLOUDROOTMOUNTPOINT=/mnt/cloud 23 | 24 | SCRIPTPID=$$ 25 | export INTERACTIVE=1 26 | 27 | custom_params() { 28 | PARAMS="DISABLE BINDSD BINDPOINT" 29 | BAD_SYNTAX="(^\s*#|^\s*$|^\s*[a-z_][^[:space:]]*=[^;&\(\`]*$)" 30 | if [ -f "$USER_CONFDIR/.$remote.param" ]; then 31 | echo "Found .$remote.param" 32 | if ! (grep -E -ivq "$BAD_SYNTAX" "$USER_CONFDIR/.$remote.param"); then 33 | echo "loading .$remote.param" 34 | for PARAM in "${PARAMS[@]}"; do 35 | while read -r VAR; do 36 | if (echo "$VAR" | grep -qw "$PARAM"); then 37 | echo "Importing $VAR" 38 | eval "$(echo "$VAR" | cut -d ' ' -f 1)" 39 | fi 40 | done <"$USER_CONFDIR/.$remote.param" 41 | done 42 | else 43 | echo ".$remote.param contains bad syntax" 44 | fi 45 | fi 46 | } 47 | 48 | config() { 49 | if [ ! -d "$USER_CONFDIR" ]; then 50 | mkdir "$USER_CONFDIR" 51 | fi 52 | if [ -f "$USER_CONF" ]; then 53 | cp "$USER_CONF" "$CONFIGFILE" 54 | fi 55 | $RCLONE_BIN config && cp "$CONFIGFILE" "$USER_CONF" && echo && remount 56 | } 57 | 58 | help() { 59 | $RCLONE_BIN help 60 | echo 61 | echo 'Wrapper Commands:' 62 | echo ' disable Disable a specified remote which exist in rclone.conf.' 63 | echo ' remount Remount the remotes inside rclone.conf except disabled.' 64 | echo ' unmount Kill rclone & unmount all remotes.' 65 | } 66 | 67 | disable() { 68 | echo "disabling remote $1" 69 | touch "$USER_CONFDIR/.$1.disable" 70 | remount 71 | } 72 | 73 | unmount() { 74 | echo "Killing & Unmounting Remotes...." 75 | echo 76 | kill "$(pgrep -f rclone | grep -v "$SCRIPTPID")" >>/dev/null 2>&1 77 | sleep 1 78 | { 79 | umount -lf ${CLOUDROOTMOUNTPOINT}/* 2>&1 80 | umount -lf ${CLOUDROOTMOUNTPOINT} 2>&1 81 | } >>/dev/null 82 | ${RCLONE_BIN} purge ${CLOUDROOTMOUNTPOINT} >>/dev/null 2>&1 83 | } 84 | 85 | sd_unbind_func() { 86 | if [ -z "$BINDPOINT" ]; then 87 | UNBINDPOINT=${BINDPOINT_D}/${remote} 88 | su -M -c umount -lf "$UNBINDPOINT" >>/dev/null 2>&1 89 | UNBINDPOINT=${BINDPOINT_R}/${remote} 90 | su -M -c umount -lf "$UNBINDPOINT" >>/dev/null 2>&1 91 | UNBINDPOINT=${BINDPOINT_W}/${remote} 92 | su -M -c umount -lf "$UNBINDPOINT" >>/dev/null 2>&1 93 | else 94 | USER_BINDPOINT=${BINDPOINT} 95 | UNBINDPOINT=${RUNTIME_D}/emulated/0/${USER_BINDPOINT} 96 | su -M -c umount -lf ${UNBINDPOINT} >>/dev/null 2>&1 97 | UNBINDPOINT=${RUNTIME_R}/emulated/0/${USER_BINDPOINT} 98 | su -M -c umount -lf ${UNBINDPOINT} >>/dev/null 2>&1 99 | UNBINDPOINT=${RUNTIME_W}/emulated/0/${USER_BINDPOINT} 100 | su -M -c umount -lf ${UNBINDPOINT} >>/dev/null 2>&1 101 | fi 102 | } 103 | 104 | sd_unbind() { 105 | $RCLONE_BIN listremotes --config "$CONFIGFILE" | cut -f1 -d: | while read -r remote; do 106 | echo 107 | custom_params 108 | sd_unbind_func 109 | done >>/dev/null 2>&1 110 | } 111 | 112 | remount() { 113 | sd_unbind 114 | unmount 115 | "$MODDIR"/service.sh 116 | } 117 | 118 | if [ "$1" = disable ]; then 119 | disable "$2" 120 | elif [ "$1" = remount ]; then 121 | remount 122 | elif [ "$1" = unmount ]; then 123 | sd_unbind 124 | unmount 125 | elif [ "$1" = config ]; then 126 | config 127 | elif [ "$1" = help ]; then 128 | help 129 | elif [ "$1" = --help ]; then 130 | help 131 | elif [ -z "$1" ]; then 132 | help 133 | else 134 | $RCLONE_BIN "$@" 135 | fi 136 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |