[Fai-commit] r4304 - trunk/bin

lange at alioth.debian.org lange at alioth.debian.org
Sun Jun 10 20:18:06 UTC 2007


Author: lange
Date: 2007-06-10 20:18:05 +0000 (Sun, 10 Jun 2007)
New Revision: 4304

Modified:
   trunk/bin/faimond
Log:
add option -b, -h, -p (closes: #342477, #424608)


Modified: trunk/bin/faimond
===================================================================
--- trunk/bin/faimond	2007-06-10 20:04:19 UTC (rev 4303)
+++ trunk/bin/faimond	2007-06-10 20:18:05 UTC (rev 4304)
@@ -6,17 +6,18 @@
 # faimond -- monitor daemon which collects client status info
 #
 # This script is part of FAI (Fully Automatic Installation)
-# (c) 2003-2004 by Thomas Lange, lange at informatik.uni-koeln.de
+# (c) 2003-2007 by Thomas Lange, lange at informatik.uni-koeln.de
 # Universitaet zu Koeln
 #
 #*********************************************************************
 
 use strict;
 use Socket;
+use Getopt::Std;
 
 $| = 1;
-my $port = 4711;
-
+my $port;
+our ($opt_b,$opt_h,$opt_p);
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 sub server_init() {
 
@@ -38,10 +39,36 @@
   while ($client_addr = accept(CLIENT, SERVER)) {
     $inp = <CLIENT>;
     close CLIENT;
+
+    if ($inp =~ /^(\S+)\s+TASKEND install 0/ && $opt_b) {
+      my $cname = $1;
+      system("fai-chboot -d $cname");
+      # warn "Disabling pxelinux configuration for $cname\n";
+   }
     print "$inp";
   }
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+sub usage {
 
+  print << "EOF";
+faimond, FAI monitor daemon.
+
+   Copyright (C) 2003-2007 by Thomas Lange
+
+Usage: faimond [OPTION]
+
+   -b                   Call fai-chboot to change boot parameter.
+   -p PORT              Set port to listen to. Default is 4711.
+
+EOF
+  exit 0;
+}
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+getopts('bhp:') || usage;
+$opt_h && usage;
+$port = $opt_p || 4711;
+
 server_init;
 big_loop;




More information about the Fai-commit mailing list