We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72ded52 commit accce12Copy full SHA for accce12
README.md
@@ -4799,6 +4799,20 @@ Using the keyword <code>read</code> so for example <code>read x</code> will wait
4799
4800
<details>
4801
<summary>Write a script to determine whether a host is up or down</summary><br><b>
4802
+
4803
+```
4804
+#!/bin/bash
4805
+SERVERIP=<IP Address>
4806
+[email protected]
4807
4808
+ping -c 3 $SERVERIP > /dev/null 2>&1
4809
+if [ $? -ne 0 ]
4810
+then
4811
+ # Use mailer here:
4812
+ mailx -s "Server $SERVERIP is down" -t "$NOTIFYEMAIL" < /dev/null
4813
+fi
4814
4815
4816
</b></details>
4817
4818
0 commit comments