I make deploy Bash script and I have a problem. I don't understand how I can use if/else for select server and run commands on server. I'd like run script with params:
sh deploy.sh beta
or
sh deploy.sh production
My script:
#!/bin/bash
production='user@production_server'
beta='user@beta_server'
demon_path='demon'
params=$1
if [[ params == "production" ]]
then ssh -A $production
else
ssh -A $beta
fi
"
cd $demon_path
git checkout master
git pull --rebase
touch restart.txt
exit
"
sh
. – gniourf_gniourf