copy the script to remote host after getting the ip