script to ftp file (ip change)

Hi All,
If I want to ftp files from machine to local pc. But the ip must change everytime :frowning: (due to VPN), can I write a script to easiler (no need to update ip in script)?

user_name=aaa
password=bbb
cat ip.txt
#
# FTP the files
#
ftp -d -in 199.200.204.109 <<EOF
user $user_name $password
bin
cd /temp

if you have file with ip address (i.e. ip.txt) you can use it in your script.
write `cat ip.txt` instead of ip address in ftp command (don't change back quotes)

Thank you!!! it work. :slight_smile: