/[clonezilla-sysresccd]/trunk/create-clonezilla-sysresccd/files/cust-menu
ViewVC logotype

Diff of /trunk/create-clonezilla-sysresccd/files/cust-menu

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

revision 176 by sng, Fri Sep 24 12:58:07 2010 UTC revision 177 by sng, Wed Jun 1 12:33:25 2011 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  ##############################################################################  ##############################################################################
3  #                                                                            #  #                                                                            #
4  # cust-menu, (C) 2007-2010 S. Georgaras <sng@hellug.gr>                      #  # cust-menu, (C) 2007-2011 S. Georgaras <sng@hellug.gr>                      #
5  #                                                                            #  #                                                                            #
6  # This file is part of Clonezilla-SysRescCD.                                 #  # This file is part of Clonezilla-SysRescCD.                                 #
7  #                                                                            #  #                                                                            #
# Line 189  import_parameters_to_cfg $templateCFG $f Line 189  import_parameters_to_cfg $templateCFG $f
189    
190  if [ -z "$CUSTOMIZE" ];then  if [ -z "$CUSTOMIZE" ];then
191    
192  # DVD Title    if [ -e $HOME/.last-cust-menu-values ];then
193  whiptail --backtitle Clonezilla-SysRescCD --title ' Menu Title ' --inputbox 'Insert the Title for the menu' 8 60 "$(grep 'MENU TITLE' $finalCFG | sed 's|^ *MENU TITLE  *||' | sed 's|   *||g')" 2>/tmp/answer    
194  menuTitle=`cat /tmp/answer`      whiptail --backtitle Clonezilla-SysRescCD --title ' Config found!!!' --yesno 'You can use the same values you inserted on a previous customization.\n\nDo you want to use these values?' 11 45
195        if [ $? -eq 0 ];then
196  rm /tmp/answer 2>/dev/null        . $HOME/.last-cust-menu-values
197          useOldCustomizationValues=yes
198        fi
199      fi
 # Item caption  
 whiptail --backtitle Clonezilla-SysRescCD --title ' Menu Items Caption ' --inputbox 'Insert the Caption for each manu item' 8 60 'Clonezilla Live' 2>/tmp/answer  
 itemCaption=`cat /tmp/answer`  
   
 rm /tmp/answer 2>/dev/null  
   
   
 #  
 whiptail --backtitle Clonezilla-SysRescCD --title ' Boot delay ' --inputbox 'Insert the boot delay in seconds' 8 60 30 2>/tmp/answer  
 bootDelay=`cat /tmp/answer`  
 if [ "$bootDelay" = "30" ];then  
   bootDelay=''  
 fi  
 rm /tmp/answer 2>/dev/null  
200    
201      # DVD Title
202      if [ -z "$useOldCustomizationValues" ];then
203        whiptail --backtitle Clonezilla-SysRescCD --title ' Menu Title ' --inputbox 'Insert the Title for the menu' 8 60 "$(grep 'MENU TITLE' $finalCFG | sed 's|^ *MENU TITLE  *||' | sed 's|   *||g')" 2>/tmp/answer
204        menuTitle=`cat /tmp/answer`
205        echo "menuTitle=$menuTitle"  | sed 's/ /\\ /g' >> $HOME/.last-cust-menu-values
206        rm /tmp/answer 2>/dev/null
207      
208      
209      
210        # Item caption
211        whiptail --backtitle Clonezilla-SysRescCD --title ' Menu Items Caption ' --inputbox 'Insert the Caption for each menu item' 8 60 'Clonezilla Live' 2>/tmp/answer
212        itemCaption=`cat /tmp/answer`
213        echo "itemCaption=$itemCaption"  | sed 's/ /\\ /g' >> $HOME/.last-cust-menu-values
214        
215        rm /tmp/answer 2>/dev/null
216    
217    
218        #
219        whiptail --backtitle Clonezilla-SysRescCD --title ' Boot delay ' --inputbox 'Insert the boot delay in seconds' 8 60 30 2>/tmp/answer
220        bootDelay=`cat /tmp/answer`
221        if [ "$bootDelay" = "30" ];then
222          bootDelay=''
223        fi
224        echo "bootDelay=$bootDelay"  | sed 's/ /\\ /g' >> $HOME/.last-cust-menu-values
225        rm /tmp/answer 2>/dev/null
226    
 #  
 # Default boot item  
 #  
227    
228    
229    
230  echo "whiptail --backtitle Clonezilla-SysRescCD --title ' Default Boot Item ' --menu 'Select      #
231        # Default boot item
232        #
233      
234      
235      
236        echo "whiptail --backtitle Clonezilla-SysRescCD --title ' Default Boot Item ' --menu 'Select
237      Item 6 - Boot from the first hard disk      Item 6 - Boot from the first hard disk
238  to maintain current setting  to maintain current setting
239  ' 0 60 0 \\" > /tmp/q.$$  ' 0 60 0 \\" > /tmp/q.$$
240      
241        grep 'MENU LABEL' "$templateCFG"  | sed '/---/d' | sed 's|^.*MENU LABEL *||' | sed "s|^|'|" | sed "s|$|'|" | awk '{print NR " " ""$0"" " "}' | tr -d '\n$' > /tmp/qq.$$
242      
243        oldCaption=`sed 's|^1  *.||' /tmp/qq.$$ | sed "s|  *-.*||"`
244        echo "oldCaption=$oldCaption"  | sed 's/ /\\ /g' >> $HOME/.last-cust-menu-values
245        
246        if [ -n  "$itemCaption" ];then
247          sed "s/$oldCaption/$itemCaption/g" /tmp/qq.$$ >> /tmp/q.$$
248        else
249          cat /tmp/qq.$$ >> /tmp/q.$$
250        fi
251      
252        echo "2>/tmp/answer" >> /tmp/q.$$
253        rm /tmp/qq.$$
254        . /tmp/q.$$
255        rm /tmp/q.$$
256        
257        defItem=`cat /tmp/answer`
258        if [ $defItem -gt 6 ];then ((defItem++));fi
259        ((defItem++))
260        #if [ $defItem -eq 6 ];then defItem='';fi
261        if [ $defItem -eq 7 ];then defItem='';fi
262        rm /tmp/answer 2>/dev/null
263        echo "defItem=$defItem"  | sed 's/ /\\ /g' >> $HOME/.last-cust-menu-values
264    
 grep 'MENU LABEL' "$templateCFG"  | sed '/---/d' | sed 's|^.*MENU LABEL *||' | sed "s|^|'|" | sed "s|$|'|" | awk '{print NR " " ""$0"" " "}' | tr -d '\n$' > /tmp/qq.$$  
   
 oldCaption=`sed 's|^1  *.||' /tmp/qq.$$ | sed "s|  *-.*||"`  
   
 if [ -n  "$itemCaption" ];then  
   sed "s/$oldCaption/$itemCaption/g" /tmp/qq.$$ >> /tmp/q.$$  
 else  
   cat /tmp/qq.$$ >> /tmp/q.$$  
 fi  
   
 echo "2>/tmp/answer" >> /tmp/q.$$  
 rm /tmp/qq.$$  
 . /tmp/q.$$  
 rm /tmp/q.$$  
   
 defItem=`cat /tmp/answer`  
 if [ $defItem -gt 6 ];then ((defItem++));fi  
 ((defItem++))  
 #if [ $defItem -eq 6 ];then defItem='';fi  
 if [ $defItem -eq 7 ];then defItem='';fi  
 rm /tmp/answer 2>/dev/null  
   
   
 # Boot Screen Image  
 whiptail --backtitle Clonezilla-SysRescCD --title ' Boot Screen Image ' --inputbox 'Insert the Image to be displayed on the Boot Screen  
   
 The file must be a 640x480 32-bit png image' 0 60 ocswp.png 2>/tmp/answer  
 bootImage=`cat /tmp/answer`  
 if [ "$bootImage" = "ocswp.png" ];then  
         bootImage=''  
 fi  
 rm /tmp/answer 2>/dev/null  
265    
266        # Boot Screen Image
267        whiptail --backtitle Clonezilla-SysRescCD --title ' Boot Screen Image ' --inputbox 'Insert the Image to be displayed on the Boot Screen
268        
269        The file must be a 640x480 32-bit png image' 0 60 ocswp.png 2>/tmp/answer
270        bootImage=`cat /tmp/answer`
271        if [ "$bootImage" = "ocswp.png" ];then
272            bootImage=''
273        fi
274        echo "bootImage=$bootImage"  | sed 's/ /\\ /g' >> $HOME/.last-cust-menu-values
275        rm /tmp/answer 2>/dev/null
276    
277    
278    
 if [ "$type" = "ISO" ];then  
   # ISO Label  
   whiptail --backtitle Clonezilla-SysRescCD --title ' ISO Label ' --inputbox 'Insert the Volume Label of the ISO file' 0 60 "$isoLabel" 2>/tmp/answer  
   isoLabelTMP=`cat /tmp/answer`  
   if [ -z "$isoLabelTMP" ];then  
           isoLabelTMP="$isoLabel"  
   fi  
   rm /tmp/answer 2>/dev/null  
279    
280        if [ "$type" = "ISO" ];then
281          # ISO Label
282          whiptail --backtitle Clonezilla-SysRescCD --title ' ISO Label ' --inputbox 'Insert the Volume Label of the ISO file' 0 60 "$isoLabel" 2>/tmp/answer
283          isoLabelTMP=`cat /tmp/answer`
284          if [ -z "$isoLabelTMP" ];then
285                  isoLabelTMP="$isoLabel"
286          fi
287          echo "isoLabelTMP=$isoLabelTMP"  | sed 's/ /\\ /g' >> $HOME/.last-cust-menu-values
288          rm /tmp/answer 2>/dev/null
289        
290        
291        
292          # Publisher ID
293          whiptail --backtitle Clonezilla-SysRescCD --title ' Publisher ID ' --inputbox 'Insert the Publisher ID of the ISO file' 0 60 "$isoPublisher" 2>/tmp/answer
294          isoPublisherTMP=`cat /tmp/answer`
295          if [ -z "$isoPublisherTMP" ];then
296                  isoPublisherTMP="$isoPublisher"
297          fi
298          echo "isoPublisherTMP=$isoPublisherTMP"  | sed 's/ /\\ /g' >> $HOME/.last-cust-menu-values
299          rm /tmp/answer 2>/dev/null
300        
301          echo "$isoLabelTMP" > /tmp/isodata
302          echo "$isoPublisherTMP" >> /tmp/isodata
303        fi
304    
305    
   # Publisher ID  
   whiptail --backtitle Clonezilla-SysRescCD --title ' Publisher ID ' --inputbox 'Insert the Publisher ID of the ISO file' 0 60 "$isoPublisher" 2>/tmp/answer  
   isoPublisherTMP=`cat /tmp/answer`  
   if [ -z "$isoPublisherTMP" ];then  
           isoPublisherTMP="$isoPublisher"  
306    fi    fi
   rm /tmp/answer 2>/dev/null  
   
   echo "$isoLabelTMP" > /tmp/isodata  
   echo "$isoPublisherTMP" >> /tmp/isodata  
 fi  
   
   
   
307    
308    
309  ############################################################################  ############################################################################
# Line 326  fi Line 343  fi
343    
344  copy_PNG_SYSLINUX  copy_PNG_SYSLINUX
345    
346    

Legend:
Removed from v.176  
changed lines
  Added in v.177

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26