Skip to content

Commit

Permalink
Migrate configuration files to /sdcard/Android
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard20181 committed Oct 30, 2022
1 parent e96aa70 commit 36b7021
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
19 changes: 13 additions & 6 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,21 @@ set_perm "$MODPATH"/rclone 0 0 0755
[ -d "$MODPATH/system/bin" ] && set_perm_recursive "$MODPATH/system/bin" 0 0 0755 0755
[ -d "$MODPATH/system/lib" ] && set_perm_recursive "$MODPATH/system/lib" 0 0 0755 0644 u:object_r:system_lib_file:s0
[ -d "$MODPATH/system/lib64" ] && set_perm_recursive "$MODPATH/system/lib64" 0 0 0755 0644 u:object_r:system_lib_file:s0

if [ -f "/sdcard/.rclone/rclone.conf" ]; then
export INTERACTIVE=1
ui_print ""
USER_CONFDIR_OLD=/sdcard/.rclone
USER_CONFDIR=/sdcard/Android/.rclone
USER_CONF=$USER_CONFDIR/rclone.conf
USER_CONF_OLD=$USER_CONFDIR_OLD/rclone.conf
if [ -f "$USER_CONF" ]; then
ui_print
ui_print "- Please reboot to take effect"
ui_print ""
ui_print
elif [ -f "$USER_CONF_OLD" ] && [ ! -d "$USER_CONFDIR" ]; then
ui_print "- Migrating config file to $USER_CONFDIR"
mkdir -p "$USER_CONFDIR"
mv "$USER_CONFDIR_OLD"/* "$USER_CONFDIR"/
rm -rf "${USER_CONFDIR_OLD:?}"
else
ui_print "'/sdcard/.rclone/rclone.conf' not found!"
ui_print "'$USER_CONF' not found!"
ui_print
ui_print "Additional setup required..."
ui_print "------------------------------------"
Expand Down
4 changes: 2 additions & 2 deletions service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ MODDIR=${0%/*}

# MODULE VARS
CLOUDROOTMOUNTPOINT=/mnt/cloud
USER_CONFDIR=/sdcard/.rclone
USER_CONF=${USER_CONFDIR}/rclone.conf
USER_CONFDIR=/sdcard/Android/.rclone
USER_CONF=$USER_CONFDIR/rclone.conf
PROFILE=0
DATA_MEDIA=/data/media
RUNTIME_R=/mnt/runtime/read
Expand Down
2 changes: 1 addition & 1 deletion system/bin/rclone
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MODDIR=${MODDIR:-$(magisk --path)/.magisk/modules/rclone.mount}
RCLONE_BIN=${MODDIR}/rclone
echo "Using 'rclone' binary: ${RCLONE_BIN}"

USER_CONFDIR=/sdcard/.rclone
USER_CONFDIR=/sdcard/Android/.rclone
USER_CONF=${USER_CONFDIR}/rclone.conf
export XDG_CONFIG_HOME=/data/local/tmp/
CONFIGFILE="$XDG_CONFIG_HOME"/rclone/rclone.conf
Expand Down
2 changes: 1 addition & 1 deletion uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MODDIR=${0%/*}

CONFIGFILE=/sdcard/.rclone/rclone.conf
CONFIGFILE=/sdcard/Android/.rclone/rclone.conf
CLOUDROOTMOUNTPOINT=/mnt/cloud/

"$MODDIR"/rclone listremotes --config ${CONFIGFILE}|cut -f1 -d: |
Expand Down

0 comments on commit 36b7021

Please sign in to comment.