shell scripting

iptables check every hour

Always use full path i.e /sbin/iptables for setting iptables in crontab 0 * * * * /bin/sh /bum/ #!/bin/bash##Check if firewall is upISUP=`/sbin/iptables -L -n | grep DROP`if [ -z “$ISUP” ]thenecho “Firewall is down on `hostname`” | mail -s “Firewall Status” linux@drushti.infi chmod 700

shell scripting

Conditionals let us decide whether to perform an action or not, this decision is taken by evaluating an expression. Expressions An expression can be: String comparison, Numeric comparison, File operators and Logical operators and it is represented by [expression]: String Comparisons: ——————————— = compare if two strings are equal != compare if two strings are …

shell scripting Read More »

Open chat