How to run multiple commands in bash

How to run multiple commands in bash

One team

ssh root@server. “command 1 && command 2”

Connecting to the server in a bash script

To connect via SSH and enter commands further:

#! / bin / bash

ssh -tt root@111.111.111.111 << EOF
# switch path
cd /home/user/ploshadka.net/

# turn on environment
source venv / bin / activate

git pull
sudo systemctl restart some.service

bash -l
EOF

By the way, there are no advertisements on the site. The site does not have a goal of self-sufficiency, but if the information is useful to you, you can donate me for a cup of coffee in a McDuck. Like the page or just say thank you. Karma will be credited to you.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *