already
I created the executable.
I'm now wanting to delete the variable so it won't stay in memory.
what executable
, do you mean the .bat file?
Dear friend,
I got what I was trying to do successfully.
I'll convert the file and I'll tell you
I am not sure this will help you but let me tell you what I have done for me.
I have a crypt remote I do not want stored in my rclone config. However, it wraps a OneDrive remote that gets updated access tokens. So I make it on the fly with something as follows:
First, I made a text file that had something like: (these are not sensitive. Just for demo)
tmp.sh
:
export RCLONE_CRYPT_PASSWORD=RcqOFMT48GrYv0Kt-wbwMdmaayQMZWD9dUXl
export RCLONE_CRYPT_PASSWORD2=IW60s-v2S7hOtchizZf1k3O-D4QV-6o39639
Then I run:
$ openssl AES256 -base64 -pbkdf2 -iter 100000 -salt -in tmp.sh
# <prompts for password>
U2FsdGVkX19DKWrYjs/sfcWzSvdO0wIMP4QL85zHdp7IUyJ6Hr6Fm/Nmuoz4/dNI
FDiMRiuwiwfHbMwL7WGps9V1DlNo51z5sAr1DtUVp0/M3M7c6HFSsniyQddc9Maa
g1+H8avw0Xan5qiKmeVI9ASrsXcwRVAzPCCgo3arvFIDgWB3Siu4p0CV6X+A85+0
08oGu8Q5TV0IZHxCejxLjg==
Now delete tmp.sh
Then, I have the following
setup.sh
:
export RCLONE_CRYPT_REMOTE='onedrive:mycrypt'
secret="U2FsdGVkX19DKWrYjs/sfcWzSvdO0wIMP4QL85zHdp7IUyJ6Hr6Fm/Nmuoz4/dNI
FDiMRiuwiwfHbMwL7WGps9V1DlNo51z5sAr1DtUVp0/M3M7c6HFSsniyQddc9Maa
g1+H8avw0Xan5qiKmeVI9ASrsXcwRVAzPCCgo3arvFIDgWB3Siu4p0CV6X+A85+0
08oGu8Q5TV0IZHxCejxLjg=="
vv=$(echo "$secret" | openssl AES256 -d -base64 -pbkdf2 -iter 100000 -salt)
# https://superuser.com/a/284226
while IFS= read -r line; do
eval "$line"
done <<< "$vv"
So to get this, I do:
source setup.sh
# <enter password>
rclone copy local/files/or/whatever :crypt:
I even have one where it gets more complex with connection strings or dynamically named remotes but that is another issue.
thank you, I managed to solve!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.