I'm writing a script that will backup data from my laptop to an Ubuntu server.
To do so, I'm looking for a (ba)sh command to test if the server is available before starting the backup. something like ping
on port 22 that returns a boolean.
How can I do this?
Best Answer
Like this:
If it's
0
then it's available. If it's1
then it's not.