Ah, so embarrassed. I'm so used to using # comments that i didn't even
think about that open /* tag.
Thanks much.
Josh
Scott Ullrich wrote:
Try uncommenting /* *OR* to get the LAN interface, use this:
:)
On 1/13/06, Josh Stompro <[EMAIL PROTECTED]> wrote:
When I run
---
#!/usr/local/bin/php
<?php
require("functions.inc");
require("config.inc");
/* *OR* to get the LAN interface, use this:
$if =
convert_friendly_interface_to_real_interface_name("LAN");
/* echo out the interface that we found for this assignment */
echo "Interface is $if \n";
echo "Direct read of \$config is
".$config['interfaces']['lan']['if']."\n";
?>
---
The output is
# ./landown.php
Content-type: text/html
X-Powered-By: PHP/4.4.0
Interface is
Direct read of $config is xl1
For some reason $if is not getting the value assigned to it.
doing
echo
convert_friendly_interface_to_real_interface_name("LAN");
prints out the correct value.
What am I missing?
Josh
Scott Ullrich wrote:
On 1/12/06, Scott Ullrich <[EMAIL PROTECTED]> wrote:
This PHP script may be helpful. Simply duplicate it once for up and
down and call them from cron.php. Note that I commented the command
to down the interface out so that there is no foot shooting until
you're absolutely ready.
Woops, here it is:
<?php
require("functions.inc");
require("config.inc");
/* to get the wan interface, use this: */
$if = get_real_wan_interface();
/* *OR* to get the LAN interface, use this:
$if =
convert_friendly_interface_to_real_interface_name("LAN");
/* echo out the interface that we found for this assignment */
echo $if;
/* or you could do something like this:
exec("/sbin/ifconfig {$if} down");
*/
?>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
--
Josh Stompro | Office 218.233.3757 EXT-139
LARL Network Coordinator | Mobile 701.371.3857
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
--
Josh Stompro | Office 218.233.3757 EXT-139
LARL Network Coordinator | Mobile 701.371.3857
|