[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

checking integers in scripts?



Hi,

I am trying to write a script to check if ipforwarding is running on my access box but I can't work out how to check for an integer in a script.  It may be clearer what I am trying to do for the bit of the script:

#Check if ipfwadm is on
IPFORW = `cat /proc/sys/net/ipv4/ip_forward`
if [ IPFORW == 0 ]; then
	echo "ipforwarding is OFF"
	exit 0
fi

I have tried stuff like using 'let' and putting brackets round the expression but just can't get it right.  I clearly am not getting what the O'Reilly book is trying to tell me about numerical values.  Can anyone help please?

Thanks,

Steve


Reply to: