/[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 58 by sng, Tue May 25 09:02:17 2010 UTC revision 64 by sng, Fri May 28 09:47:17 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      if [ "$onlyBurnISO" -eq 1 ];then
420        echo "  Error: Conflicting parameters -a and -b used"
421                    exit 1
422            fi
423    fi
424    
425  # Check input parameters  # Check input parameters
426  checkInParms=0  checkInParms=0
427  checkInParms=$(( onlyBurnISO + onlyCreateISO + onlyCopyFiles + noFileCopy ))  checkInParms=$(( onlyBurnISO + onlyCreateISO + onlyCopyFiles + noFileCopy ))
# Line 435  if [ $onlyBurnISO -eq 0 ];then Line 455  if [ $onlyBurnISO -eq 0 ];then
455  #    #  
456  # Is this correct? (y/[n]): "  # Is this correct? (y/[n]): "
457    
458    if [ -n "$auto" ]; then
459    ans=y
460    else
461    echo -n "Current settings:    echo -n "Current settings:
462       System Rescue CD: $sysCD       System Rescue CD: $sysCD
463       Clonezilla Live CD: $cloneCD       Clonezilla Live CD: $cloneCD
# Line 443  if [ $onlyBurnISO -eq 0 ];then Line 466  if [ $onlyBurnISO -eq 0 ];then
466        
467  Is this correct? (y/[n]): "  Is this correct? (y/[n]): "
468        
469     read ans         read ans
470        fi
471     if [ "$ans" = "n" ] || [ "$ans" = "N" ] || [ "$ans" = "" ];then     if [ "$ans" = "n" ] || [ "$ans" = "N" ] || [ "$ans" = "" ];then
472      sysCD=''      sysCD=''
473      cloneCD=''      cloneCD=''
# Line 455  Is this correct? (y/[n]): " Line 479  Is this correct? (y/[n]): "
479     test -z "$preparerID" && getPreparer     test -z "$preparerID" && getPreparer
480     test -z "$publisher" && getPublisher     test -z "$publisher" && getPublisher
481     test -z "$volLabel" && getvolLabel     test -z "$volLabel" && getvolLabel
482     clear  
483        if [ -n "$auto" ]; then
484          ans=y
485        else
486                    clear
487    echo -n "Current CD info:    echo -n "Current CD info:
488       Preparer: $preparerID       Preparer: $preparerID
489       Publisher: $publisher       Publisher: $publisher
490       Volume label: $volLabel       Volume label: $volLabel
491    
492  Is this correct? (y/[n]): "  Is this correct? (y/[n]): "
493     read ans         read ans
494        fi
495     if [ "$ans" = "n" ] || [ "$ans" = "N" ] || [ "$ans" = "" ];then     if [ "$ans" = "n" ] || [ "$ans" = "N" ] || [ "$ans" = "" ];then
496      preparerID=''      preparerID=''
497      publisher=''      publisher=''
# Line 551  Is this correct? (y/[n]): " Line 580  Is this correct? (y/[n]): "
580    WHERE="$(pwd)"    WHERE="$(pwd)"
581    mkdir /root/tmp/clonezilla-sysresccd/restorecd 2>/dev/null    mkdir /root/tmp/clonezilla-sysresccd/restorecd 2>/dev/null
582    cd /root/.clonezilla-sysresccd/files    cd /root/.clonezilla-sysresccd/files
583    cp -L pre* ocs-iso what-cd continue-multi-cd isolinux-restore-cd.cfg \    cp -L pre* ocs-iso what-cd patch-clonezilla-sysresccd continue-multi-cd isolinux-restore-cd.cfg \
584      isolinux-restore-cd-ram.cfg menu-iso.tar.gz doc.tar.gz imginfo imgconvert cust-menu /root/tmp/clonezilla-sysresccd/restorecd      isolinux-restore-cd-ram.cfg menu-iso.tar.gz doc.tar.gz imginfo imgconvert cust-menu /root/tmp/clonezilla-sysresccd/restorecd
585    cp -L default-restore-ocswp.png /root/tmp/clonezilla-sysresccd/restorecd/ocswp.png    cp -L default-restore-ocswp.png /root/tmp/clonezilla-sysresccd/restorecd/ocswp.png
586    cp sbminst /root/tmp/clonezilla-sysresccd/restorecd    cp sbminst /root/tmp/clonezilla-sysresccd/restorecd
# Line 609  Is this correct? (y/[n]): " Line 638  Is this correct? (y/[n]): "
638      cleanUp      cleanUp
639      exit 1      exit 1
640     }     }
   fi  
641    echo 'done'    echo 'done'
642      fi
643  #   echo  #   echo
644  #   echo  #   echo
645  #   echo  #   echo
# Line 636  Is this correct? (y/[n]): " Line 665  Is this correct? (y/[n]): "
665    cleanUp    cleanUp
666   fi   fi
667   echo   echo
668   echo -n "Ready to create the new ISO file.  if [ -z "$auto" ]; then
669     echo -n "Ready to create new ISO file.
670    
671  ************************************************************************  ************************************************************************
672     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 678  Is this correct? (y/[n]): "
678    
679  Press ENTER to continue...   "  Press ENTER to continue...   "
680    read    read
681    else
682      echo "Creating new ISO file."
683    fi
684    find /root/tmp/clonezilla-sysresccd -name "*~" -exec rm '{}' ';'    find /root/tmp/clonezilla-sysresccd -name "*~" -exec rm '{}' ';'
685  #   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
686    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 695  if [ -n "$chIsoHyb" ];then
695    echo 'done'    echo 'done'
696  fi  fi
697    
698    if [ -z "$auto" ];then
699  echo '  echo '
700    
701  '  '
702    fi
703  else  else
704   while [ ! -r "$outFile" ];do   while [ ! -r "$outFile" ];do
705    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 714  if [ $onlyCreateISO -eq 1 ];then ans=n;f
714  while [ 1 ];do  while [ 1 ];do
715   if [ "$ans" = "" ];then ans=y;fi   if [ "$ans" = "" ];then ans=y;fi
716   if [ "$ans" = "y" ] || [ "$ans" = "Y" ] || [ "$ans" = "n" ] || [ "$ans" = "N" ];then break;fi   if [ "$ans" = "y" ] || [ "$ans" = "Y" ] || [ "$ans" = "n" ] || [ "$ans" = "N" ];then break;fi
717   echo -n "Do you want to burn this ISO file? ([y]/n): "   if [ -n "$auto" ]; then
718   read ans     ans=n
719     else
720       echo -n "Do you want to burn this ISO file? ([y]/n): "
721        read ans
722     fi
723  done  done
724  burnISO=0  burnISO=0
725  if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then  if [ "$ans" = "y" ] || [ "$ans" = "Y" ];then

Legend:
Removed from v.58  
changed lines
  Added in v.64

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26