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

MAC management tool -- was: RE: [K12OSN] Logging in a terminal

On Wed, 5 Jun 2002, Bert Rolston wrote:

> This runs a Win4Lin session in full screen mode, instead of windowed mode.
> I forgot to mention this in the message. I covered it in the preceding 
> message, sorry.

yeah -- I spoke the command and the answer revealed itself 

> As an aside. Would it be possible to use this stanza, but have it parse a 
> separate file for MAC / IP addresses, and host name?

There is no internal dhcpd scripting language beyond the
'grammar' of the stanza's ... and under the Simple *nix Tool
philosophy, probably should NOT be.

That said, it is pretty trivial to parse a $file consisting 
of lines like



>            host pizza {
>             hardware ethernet 00:80:f1:00:53:6d ;
>                 fixed-address ;
>               option host-name "pizza";
>         }

in php, it would be something like:

$file = "./statics.txt";
$fp = fopen("$file","r");
while (!feof($fp)) { 
	$list($common,$MAC,$IP,$hname,$active) = 
if ("$active" == "y") {
  print "	
host $common {
     hardware ethernet$MAC ;
     fixed-address $IP ;
   option host-name "hname";
fclose ($fp);

which will build the static table stanza's to std out --
change the print to a proper puts to a filehandle to make a
file instead.  then assemble a fill ducpd.conf file from a
mess of stanza's ...  Left as an exercise for the student,
although I would appreciate seeing a MySQL backend and a CGI
front end to Add, Change, Active/Inactive, and Delete entries,
and a finished product crossing the list with a GPL license,
if someone has a couple hours to spare.

Contact me off list if you get stuck making that project, with 
a anon ftp site for me to pull code to review ... I'll polish 
and report a finished product to the group.

-- Russ Herrold

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