Membuat servis SQUID menyala terus
masukan di crontab
*/1 * * * * /bin/netstat -an | grep 8080 | grep LIST >/dev/null;[ $? -ne 0 ] && /etc/init.d/squid restart || :
itu untuk squid dengan nomor port 8080
tinggal sesuaikan portnya dengan port squid yang ada, untuk servis-servis yang lain tinggal disesuaikan.
NB :
The numeric comparisons for korn shell are
numA -eq numB - True if numA and numB are equal
numA -ne numB - True if numA and numB are not equal
numA -lt numB - True if numA is less than numB
numA -gt numB - True if numA is greater than numB
numA -le numB - True if numA is less than or equal to numB
numA -ge numB - True if numA is greater than or equal to numB
the string comparisons for korn shell are
strA = strB - True if strA matches strB
strA != strB - True if strA does not match strB
strA < strB - True if strA comes before strB in a dictionary order
strA > strB - True if strA comes after strB in a dictionary order
referensi :
http://handaru.blogsome.com/2008/05/04/bash-script-untuk-cek-host-yang-up-di-jaringan/
http://www.unix.com/shell-programming-scripting/31774-if-eq-0-can-someone-explain.html