[Fai-commit] r4165 - trunk/bin

Thomas Lange lange at alioth.debian.org
Thu Nov 23 22:08:24 CET 2006


Author: lange
Date: 2006-11-23 22:08:24 +0100 (Thu, 23 Nov 2006)
New Revision: 4165

Modified:
   trunk/bin/fai-chboot
Log:
exit if file cannot be written


Modified: trunk/bin/fai-chboot
===================================================================
--- trunk/bin/fai-chboot	2006-11-23 21:07:03 UTC (rev 4164)
+++ trunk/bin/fai-chboot	2006-11-23 21:08:24 UTC (rev 4165)
@@ -28,7 +28,7 @@
 #*********************************************************************
 
 # variable needed: $nfsroot
-$version="version 3.2 1-nov-2006";
+$version="version 3.2.1 23-nov-2006";
 
 use Socket;
 use Net::hostent;
@@ -76,7 +76,7 @@
 
   # read all files in pxedir and add them to different arrays
 
-  opendir(DIR, $pxedir) || die "can't opendir $pxedir: $!";
+  opendir(DIR, $pxedir) || die "Can't opendir $pxedir: $!";
   foreach (readdir(DIR)) {
     next if /^\./;
     if (/^(default|[0-9A-F]+)$/) { push @enabled,   $_ ; next};
@@ -299,7 +299,7 @@
 
   my ($srcfile, $pxedir, $desthex, $desthost, $ipadr) = @_;
   open (SOURCE, "$srcfile");
-  open (DEST, ">$pxedir/$desthex");
+  open (DEST, ">$pxedir/$desthex") || die "Can't opendir $pxedir: $!";
   print DEST "# template generated by fai-chboot for host $desthost with IP $ipadr from source $srcfile\n";
   while (<SOURCE>) {
     print DEST $_;




More information about the Fai-commit mailing list