Python : Using Pexpect : ftpTestOffload.sh

#!/bin/bash

# Runs ftpTest.py to do pexpect session, checks if the file downloaded successfully, cleans up when done

cleanup(){
rm -f -- InRelease
}

ftpTest.py

if [[ -r InRelease ]] ;then
echo "Transfer succeeded"
cleanup
exit 0
fi
echo "Failed to transfer"
cleanup
exit 10