[Lunar-commits] r23718 - moonbase/trunk/utils/lilo/plugin.d

Auke Kok sofar at lunar-linux.org
Sun Mar 18 21:27:38 CET 2007


Author: sofar
Date: 2007-03-18 21:27:38 +0100 (Sun, 18 Mar 2007)
New Revision: 23718

Modified:
   moonbase/trunk/utils/lilo/plugin.d/bootloader-lilo.plugin
Log:
THIS IS PROPER BASH SYNTAX AND SCRIPT THAT COMPLAIN ABOUT THIS HAVE A BUG IN LINE ONE (1) !!!


Modified: moonbase/trunk/utils/lilo/plugin.d/bootloader-lilo.plugin
===================================================================
--- moonbase/trunk/utils/lilo/plugin.d/bootloader-lilo.plugin	2007-03-18 16:58:41 UTC (rev 23717)
+++ moonbase/trunk/utils/lilo/plugin.d/bootloader-lilo.plugin	2007-03-18 20:27:38 UTC (rev 23718)
@@ -19,9 +19,9 @@
 	debug_msg "plugin_kernel_updatebootloader_lilo ($@)"
 
 	IFS_OLD=$IFS
-	export IFS="
-"
-	rm -rf /etc/lilo.conf.new
+	export IFS=$'\n'
+
+	rm -f /etc/lilo.conf.new
 	cp /etc/lilo.conf /etc/lilo.conf.old
 
 	output_image()
@@ -70,15 +70,15 @@
 		(( IMAGE_COUNT=0 ))
 		unset IMAGE OTHER LABEL OPTIONS
 		# list old images
-		sed -n '/other\|image/,$p' /etc/lilo.conf | while read LINE ; do
+		while read LINE ; do
 			if echo $LINE | grep -qw "image\|other" ; then
 				(( IMAGE_COUNT++ ))
 				
 				# never loop beyond 14 images
-				if (( IMAGE_COUNT == 14 )) ; then
+				if (( IMAGE_COUNT == 15 )) ; then
 					break
 				fi
-			
+
 				# output and reset
 				output_image $1 $2
 				unset IMAGE OTHER LABEL OPTIONS
@@ -99,7 +99,8 @@
 					OPTIONS=( "${OPTIONS[@]}" "$LINE" )
 					;;
 			esac
-		done;
+		done < <(sed -n '/other\|image/,$p' /etc/lilo.conf)
+
 		# write the last one too
 		if [ -n "$LABEL" ] ;then
 			output_image $1 $2



More information about the Lunar-commits mailing list