home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / YaST2 / modules / AutoinstImage.ycp < prev    next >
Text File  |  2006-11-29  |  1KB  |  44 lines

  1. /**
  2.  * File:    modules/AutoinstImage.ycp
  3.  * Package:    Auto-installation
  4.  * Summary:    Process Auto-Installation Images
  5.  * Author:    Uwe Gansert <uwe.gansert@suse.de>
  6.  *
  7.  * $Id: AutoinstImage.ycp 33269 2006-10-09 08:22:24Z ug $
  8.  */
  9. {
  10.  
  11.     module "AutoinstImage";
  12.     textdomain "autoinst";
  13.  
  14.     import "Progress";
  15.     import "AutoinstConfig";
  16.     import "URL";
  17.     import "AutoinstSoftware";
  18.  
  19.     include "autoinstall/io.ycp";
  20.  
  21.     global define boolean getScript() {
  22.         boolean ret = false;
  23.         if( AutoinstSoftware::image["script_location"]:"" != "" ) {
  24.             map urltok = $[];
  25.  
  26.             urltok = URL::Parse (AutoinstSoftware::image["script_location"]:"");
  27.             string scheme      = urltok["scheme"]:"default";
  28.             string host        = urltok["host"]:"";
  29.             string filepath    = urltok["path"]:"";
  30.             ret = Get(scheme,host,filepath, AutoinstConfig::scripts_dir+"/image.sh");
  31.  
  32.         } else if( AutoinstSoftware::image["script_source"]:"" != "" ) {
  33.             SCR::Write(.target.string,  AutoinstConfig::scripts_dir+"/image.sh", AutoinstSoftware::image["script_source"]:"");
  34.             ret = true;
  35.         }
  36.         return ret;
  37.     }
  38.  
  39.     global define boolean runScript() {
  40.         SCR::Execute(.target.bash, "/bin/sh /tmp/image.sh" );
  41.         return true;
  42.     }
  43. }
  44.