Skip to content

Instantly share code, notes, and snippets.

@svinouze
Created June 14, 2021 13:59
Show Gist options
  • Save svinouze/7104e8c97b4c54c3ec723cc8da857b0b to your computer and use it in GitHub Desktop.
Save svinouze/7104e8c97b4c54c3ec723cc8da857b0b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
VARIANT='free paid enterprise'
# connect to FTP
echo open $FTP_HOST >> ftp.txt
echo user $FTP_USER $FTP_PWD >> ftp.txt
# get FTP file
# param1: variant
get_ftp_file() {
echo $awesome_app_$1.apk
}
for variant in $variants
do
# Get file path depending on variant
ftp_file=$(get_ftp_file $variant)
# archive file
echo "mmv -O $FTP_DIR/Archives $FTP_DIR/$ftp_file"
# upload to FTP
echo "put -O $FTP_DIR $ftp_file"
done >> ftp.txt
# execute script
lftp -f ftp.txt
# cleanup
rm ftp.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment