I was given a large set of project ant scripts. The script uses a number of sshexec and scp calls to remote machines. I need to change it to enable the program to run locally if needed, so i want to intercept these remote calls and replace sshexec with exec, scp with cp.
a sample call would be:
<sshexec host="${host}" username="${username}" password="${password}" trust="true" usepty="true" command="echo '${password}' | sudo -S ntpdate ${maintain.sync-time.server}" failonerror="false" />
I would need to be able to check if ${host} is remotehost or localhost, if localhost I use exec instead
now the problem is: is there a way to avoid changing all the calls one by one (they are littered in the project) or is there a way to intercept the call, check the variable then decide to use sshexec or exec?