I call the following script from rc.local using the the syntax '.
/path/script-name'.  This makes the variables $DYNIPADDR and $GATEWAY
available in shell sessions.

#! /bin/bash
DYNIPADDR=`\
/sbin/ifconfig | grep "inet addr:" | grep -v "127.0.0.1" | grep -v
"192.168.0.1" |\
sed -e 's/:/ /' | awk '{ print $3}'`
echo Your current Dynamic IP address is:  $DYNIPADDR
export DYNIPADDR

GATEWAY=`\
/sbin/ifconfig | grep "P-t-P:" |\
sed -e 's/:/ /' -e 's/:/ /' | awk '{ print $5}'`
echo Your current Gateway is:  $GATEWAY
export GATEWAY

However, I need the variables available to crond, which doesn't appear to be
happening.  Ordinarily, no one is logged into this system -- it simply acts
as a DSL router.

How do I export the variables such that crond and bash scripts that it runs
can see and use them?

bd





_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to