shell scripting

iptables check every hour

Always use full path i.e /sbin/iptables for setting iptables in crontab 0 * * * * /bin/sh /bum/iptables_check.sh #!/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 iptables_check.sh

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