/[clonezilla-sysresccd]/trunk/create-clonezilla-sysresccd/create-clonezilla-sysresccd.sh
ViewVC logotype

Diff of /trunk/create-clonezilla-sysresccd/create-clonezilla-sysresccd.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 60 by sng, Tue May 25 09:02:17 2010 UTC revision 61 by sng, Wed May 26 12:15:58 2010 UTC
# Line 24  exit 1 Line 24  exit 1
24  }  }
25    
26  function getScript(){  function getScript(){
27    if [ -n "$auto" ];then return;fi
28  echo 'Insert script to be executed'  echo 'Insert script to be executed'
29   echo -n '> '   echo -n '> '
30   read exScript   read exScript
# Line 151  exit 1 Line 152  exit 1
152  }  }
153    
154  function errorISO(){  function errorISO(){
155  echo "   Error creating the new ISO file: /root/tmp/output.iso"  echo "   Error creating new ISO file: /root/tmp/output.iso"
156  rm /root/tmp/clonezilla-sysresccd-"$outName""$version".iso 2>/dev/null  rm /root/tmp/clonezilla-sysresccd-"$outName""$version".iso 2>/dev/null
157  cleanUp  cleanUp
158  exit 1  exit 1
# Line 210  A utility to create a multi boot CD cont Line 211  A utility to create a multi boot CD cont
211    
212  Usage: $(basename $0) [options]  Usage: $(basename $0) [options]
213  Available options are:  Available options are:
214      a           run in auto mode (no confirmation, assume yes to
215                  all questions asked, no ISO burning to disk)
216    s           show profiles and let user select profile to use    s           show profiles and let user select profile to use
217    p [number]  use profile number    p [number]  use profile number
218    f           copy files only. Don't create ISO file and don't    f           copy files only. Don't create ISO file and don't
# Line 320  profilesExist=0 Line 323  profilesExist=0
323  profilesError=0  profilesError=0
324    
325    
326  while getopts ":sp:bfihvn:x:" Option  while getopts ":asp:bfihvn:x:" Option
327  do  do
328   case $Option in   case $Option in
329     a)
330      auto=yes
331            ;;
332   s)   s)
333    readConfig    readConfig
334    sourceProfiles    sourceProfiles
# Line 353  do Line 359  do
359    if [ $profilesExist -eq 1 ];then    if [ $profilesExist -eq 1 ];then
360     if $(isnumber "$OPTARG");then     if $(isnumber "$OPTARG");then
361      applyProfile $OPTARG      applyProfile $OPTARG
362                    usingProfile=yes
363     else     else
364      echo "    Error in parameter: -p $OPTARG"      echo "    Error in parameter: -p $OPTARG"
365      exit 1      exit 1
# Line 402  done Line 409  done
409  shift $(($OPTIND - 1))  shift $(($OPTIND - 1))
410    
411  test "$(whoami)" = "root" || noRoot  test "$(whoami)" = "root" || noRoot
412    
413    # chack auto mode
414    if [ -n "$auto" ];then
415      if [ -z "$usingProfile" ];then
416        echo '  Error: Parameter -a used without -p'
417                    exit 1
418            fi
419    fi
420    
421  # Check input parameters  # Check input parameters
422  checkInParms=0  checkInParms=0
423  checkInParms=$(( onlyBurnISO + onlyCreateISO + onlyCopyFiles + noFileCopy ))  checkInParms=$(( onlyBurnISO + onlyCreateISO + onlyCopyFiles + noFileCopy ))
# Line 435  if [ $onlyBurnISO -eq 0 ];then Line 451  if [ $onlyBurnISO -eq 0 ];then
451  #    #  
452  # Is this correct? (y/[n]): "  # Is this correct? (y/[n]): "
453    
454    if [ -n "$auto" ]; then
455    ans=y
456    else
457    echo -n "Current settings:    echo -n "Current settings:
458       System Rescue CD: $sysCD       System Rescue CD: $sysCD
459       Clonezilla Live CD: $cloneCD       Clonezilla Live CD: $cloneCD
# Line 443  if [ $onlyBurnISO -eq 0 ];then Line 462  if [ $onlyBurnISO -eq 0 ];then
462        
463  Is this correct? (y/[n]): "  Is this correct? (y/[n]): "
464        
465     read ans         read ans
466        fi
467     if [ "$ans" = "n" ] || [ "$ans" = "N" ] || [ "$ans" = "" ];then     if [ "$ans" = "n" ] || [ "$ans" = "N" ] || [ "$ans" = "" ];then
468      sysCD=''      sysCD=''
469      cloneCD=''      cloneCD=''
# Line 455  Is this correct? (y/[n]): " Line 475  Is this correct? (y/[n]): "
475     test -z "$preparerID" && getPreparer     test -z "$preparerID" && getPreparer
476     test -z "$publisher" && getPublisher     test -z "$publisher" && getPublisher
477     test -z "$volLabel" && getvolLabel     test -z "$volLabel" && getvolLabel
478     clear  
479        if [ -n "$auto" ]; then
480          ans=y
481        else
482                    clear
483    echo -n "Current CD info:    echo -n "Current CD info:
484       Preparer: $preparerID       Preparer: $preparerID
485       Publisher: $publisher       Publisher: $publisher
486       Volume label: $volLabel       Volume label: $volLabel
487    
488  Is this correct? (y/[n]): "  Is this correct? (y/[n]): "
489     read ans         read ans
490        fi
491     if [ "$ans" = "n" ] || [ "$ans" = "N" ] || [ "$ans" = "" ];then     if [ "$ans" = "n" ] || [ "$ans" = "N" ] || [ "$ans" = "" ];then
492      preparerID=''      preparerID=''
493      publisher=''      publisher=''
# Line 609  Is this correct? (y/[n]): " Line 634  Is this correct? (y/[n]): "
634      cleanUp      cleanUp
635      exit 1      exit 1
636     }     }
   fi  
637    echo 'done'    echo 'done'
638      fi
639  #   echo  #   echo
640  #   echo  #   echo
641  #   echo  #   echo
# Line 636  Is this correct? (y/[n]): " Line 661  Is this correct? (y/[n]): "
661    cleanUp    cleanUp
662   fi   fi
663   echo   echo
664   echo -n "Ready to create the new ISO file.  if [ -z "$auto" ]; then
665     echo -n "Ready to create new ISO file.
666    
667  ************************************************************************  ************************************************************************
668     Ready to master your CD. If you want to alter any files contained     Ready to master your CD. If you want to alter any files contained
# Line 648  Is this correct? (y/[n]): " Line 674  Is this correct? (y/[n]): "
674    
675  Press ENTER to continue...   "  Press ENTER to continue...   "
676    read    read
677    else
678      echo "Creating new ISO file."
679    fi
680    find /root/tmp/clonezilla-sysresccd -name "*~" -exec rm '{}' ';'    find /root/tmp/clonezilla-sysresccd -name "*~" -exec rm '{}' ';'
681  #   mkisofs -quiet -f -r -J -o "$outFile" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 3 -joliet-long -input-charset utf-8 -output-charset utf-8 -V "$volLabel" -publisher "$publisher" -p "$preparerID" /root/tmp/clonezilla-sysresccd || errorISO  #   mkisofs -quiet -f -r -J -o "$outFile" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -iso-level 3 -joliet-long -input-charset utf-8 -output-charset utf-8 -V "$volLabel" -publisher "$publisher" -p "$preparerID" /root/tmp/clonezilla-sysresccd || errorISO
682    mkisofs -quiet -f -r -J -o "$outFile" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "$volLabel" -publisher "$publisher" -p "$preparerID" /root/tmp/clonezilla-sysresccd || errorISO    mkisofs -quiet -f -r -J -o "$outFile" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "$volLabel" -publisher "$publisher" -p "$preparerID" /root/tmp/clonezilla-sysresccd || errorISO
# Line 662  if [ -n "$chIsoHyb" ];then Line 691  if [ -n "$chIsoHyb" ];then
691    echo 'done'    echo 'done'
692  fi  fi
693    
694    if [ -z "$auto" ];then
695  echo '  echo '
696    
697  '  '
698    fi
699  else  else
700   while [ ! -r "$outFile" ];do   while [ ! -r "$outFile" ];do
701    echo 'Insert "clonezilla-resccd" ISO file name'    echo 'Insert "clonezilla-resccd" ISO file name'
# Line 680  if [ $onlyCreateISO -eq 1 ];then ans=n;f Line 710  if [ $onlyCreateISO -eq 1 ];then ans=n;f
710  while [ 1 ];do  while [ 1 ];do
711   if [ "$ans" = "" ];then ans=y;fi   if [ "$ans" = "" ];then ans=y;fi
712   if [ "$ans" = "y" ] || [ "$ans" = "Y" ] || [ "$ans" = "n" ] || [ "$ans" = "N" ];then break;fi   if [ "$ans" = "y" ] || [ "$ans" = "Y" ] || [ "$ans" = "n" ] || [ "$ans" = "N" ];then break;fi
713   echo -n "Do you want to burn this ISO file? ([y]/n): "   if [ -n "$auto" ]; then
714   read ans     ans=n
715     else
716       echo -n "Do you want to burn this ISO file? ([y]/n): "
717        read ans
718     fi
719  done  done
720  burnISO=0  burnISO=0
721  if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then  if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then

Legend:
Removed from v.60  
changed lines
  Added in v.61

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26