Created
June 14, 2021 13:59
-
-
Save svinouze/7104e8c97b4c54c3ec723cc8da857b0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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