[Fai-commit] r3255 - in trunk: bin man
fai-repository at svn.debian.org
fai-repository at svn.debian.org
Sat Jan 21 03:56:07 UTC 2006
Author: lange
Date: 2006-01-21 03:56:07 +0000 (Sat, 21 Jan 2006)
New Revision: 3255
Modified:
trunk/bin/fai-chboot
trunk/man/fai-chboot.8
Log:
change output of -l and -L, add pattern to -l
Modified: trunk/bin/fai-chboot
===================================================================
--- trunk/bin/fai-chboot 2006-01-19 22:45:52 UTC (rev 3254)
+++ trunk/bin/fai-chboot 2006-01-21 03:56:07 UTC (rev 3255)
@@ -28,7 +28,7 @@
#*********************************************************************
# variable needed: $nfsroot
-$version="version 1.6.1, 2-jan-2006";
+$version="version 1.7 21-jan-2006";
use Socket;
use Net::hostent;
@@ -73,6 +73,8 @@
my (@n,$host,$ip,$iaddr,$hex,$kernelname,$append);
+ my $pattern = $ARGV[0]; # pattern matching for listing
+
opendir(DIR, $pxedir) || die "can't opendir $pxedir: $!";
foreach (readdir(DIR)) {
# prtipa if /^[0-9A-F]{2}$/;
@@ -99,7 +101,9 @@
$host = "unknown host: $ip";
}
}
-
+ if ($pattern) {
+ next unless $host =~ /$pattern/;
+ }
# read pxe config file for a host
undef $kernelname;
open (CFG,"$pxedir/$hex") || die "$! $@\n";
@@ -110,8 +114,14 @@
}
close (CFG);
- $opt_L or undef $append;
- printf "%-8s %-12s $kernelname $append\n",$hex,$host;
+ if ($opt_l && ! $opt_L) {
+ $append =~ /FAI_ACTION=(\S+)/;
+ $append = $1;
+ printf "%-16.16s $append $kernelname %-8s\n",$host,$hex;
+ } else {
+ printf "%s %s $kernelname $append\n",$host,$hex;
+ }
+
undef $append;
undef $kernelname;
}
Modified: trunk/man/fai-chboot.8
===================================================================
--- trunk/man/fai-chboot.8 2006-01-19 22:45:52 UTC (rev 3254)
+++ trunk/man/fai-chboot.8 2006-01-21 03:56:07 UTC (rev 3255)
@@ -1,5 +1,5 @@
.\" Hey, EMACS: -*- nroff -*-
-.TH fai-chboot 8 "26 aug 2004" "FAI 2.6.2"
+.TH fai-chboot 8 "21 jan 2006" "FAI 2.10"
.SH NAME
fai-chboot \- manage the network boot configuration files
.SH SYNOPSIS
@@ -7,7 +7,7 @@
[OPTION]... KERNELNAME ROOTFS HOST...
.br
.B fai-chboot
--l
+-l [PATTERN]
.br
.B fai-chboot
-e HOST...
@@ -67,10 +67,13 @@
Set kernel append parameters.
.TP
.B \-l
-List the configuration for all hosts in short format.
+List the configuration for all hosts in short format. If PATTERN is
+given, list only hosts matching PATTERN. Lists hostname, FAI_ACTION,
+kernel name and IP address in hex.
.TP
.B \-L
List the configuration for all hosts. Also list the kernel append parameters.
+If PATTERN is given, list only hosts matching PATTERN.
.TP
.B \-n
Do not create configuration but show what will be done. This also
More information about the Fai-commit
mailing list