sshpass -p "123456789" ssh -T jadams@192.168.1.85 <<'EOSSH'
if [-d "$HOME/ajith/apache-tomcat-7.0.63/webapps/$tag_version" ] then
sh $HOME/ajith/apache-tomcat-7.0.63/bin/shutdown.sh &&
rm -rf $HOME/ajith/apache-tomcat-7.0.63/webapps/$tag_version &&
mkdir $HOME/ajith/apache-tomcat-7.0.63/webapps/$tag_version
fi
EOSSH
This code above is a part of the shell script which I am using
The Problem :
The problem I am facing is that I am trying to execute set of commands to deploy a webapp on a remote tomcat server and the concern of my interest is that I want to be able to execute multi-line commands using sshpass as above but I am getting error as below:
-bash: line 2: syntax error: unexpected end of file
I am searching for a working example for this use-case or any assistance relevant would be of great help.
I have tried many examples from the google search results and I am unable to do it