I have a curl command which is having some issues sending data to proxy, so sometimes it sends the data perfectly other times it fails. The command looks like
curl --tlsv1 --cipher ALL --connect-timeout 90 -T nint.txt ftps://ftp.box.com/Backup/nants.txt --user "admin:pass" -x socks4://10.21.0.10:1080 -v
Now i need to write a python code which executes this command until the output contains Connection #0 to host ftp.box.com left intact
something like
def send_to_box(zip_name):
curl --tlsv1 --cipher ALL --connect-timeout 90 -T nint.txt ftps://ftp.box.com/Backup/nants.txt --user "admin:pass" -x socks4://10.21.0.10:1080 2>&1 | grep -q "Connection #0 to host ftp.box.com left intact" "
while "Connection #0 to host ftp.box.com left intact" in os.system(curl_cmd_grep):
print successful send the data
Not sure what is the best way to achive this