From 4d03a5b2f36e0c47ca78d817ebd1eb074b288a4d Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 21 Dec 2005 03:15:40 +0000 Subject: [PATCH] 2005-12-21 03:15:40 by steve Always clear the screen when we're finished. (Unless under --debug). BUGFIX: Setup the hostname correctly. --- xen-create-image | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/xen-create-image b/xen-create-image index ab54a66..66fb989 100755 --- a/xen-create-image +++ b/xen-create-image @@ -226,7 +226,7 @@ suffixed with either Mb, or Gb. -- http://www.steve.org.uk/ - $Id: xen-create-image,v 1.46 2005-12-21 03:02:31 steve Exp $ + $Id: xen-create-image,v 1.47 2005-12-21 03:15:40 steve Exp $ =cut @@ -651,6 +651,18 @@ close( XEN ); print "Done\n"; +# +# Clear screen before printing success message, unless +# we're running under '--debug'. +# +$TERMINAL_HEIGHT *= 2; +while( $TERMINAL_HEIGHT ) +{ + printWideMessage( "\n" ) unless $CONFIG{'debug'}; + $TERMINAL_HEIGHT -= 1; +} + + # # Give status message # @@ -669,21 +681,16 @@ if ( $CONFIG{'boot'} ) } else { - system( "$CONFIG{'xm'} create $CONFIG{'hostname'}.cfg" ); + # + # Start Xen instance in our forked process. Avoid annoying + # output. + # + # + system( "$CONFIG{'xm'} create $CONFIG{'hostname'}.cfg >/dev/null 2>/dev/null" ); } } else { - # - # Clear screen before printing success message. - # - $TERMINAL_HEIGHT *= 2; - while( $TERMINAL_HEIGHT ) - { - printWideMessage( "\n" ); - $TERMINAL_HEIGHT -= 1; - } - print < $prefix/etc/hostname" ); + runCommand ("echo '$CONFIG{'hostname'}' > $prefix/etc/hostname" ); open( IP, ">", $prefix . "/etc/network/interfaces" );