Brad Doster wrote:

> 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?

how about writing them to a file.  There might be a way to do this in memory, I
don't know.  I would probably just echo > /var/run/ppp.ipaddress.

Then it would be availible to any process with permissions to read it.

HTH

Bret



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

Reply via email to