Moving upload to a bash script