import babelbox-etch.tgz (thanks, bubulle)
SHA-1:b7fcbd9076903bb98474a7b6c5b4d860ece09bcd, from <http://d-i.alioth.debian.org/pub/etch/babelbox/babelbox.tgz>
This commit is contained in:
		
						commit
						635d04b29f
					
				
					 13 changed files with 598 additions and 0 deletions
				
			
		
							
								
								
									
										54
									
								
								cronscript
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										54
									
								
								cronscript
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,54 @@ | |||
| #! /bin/bash | ||||
| 
 | ||||
| # Script to prepare babelbox for the next install: switch language to the | ||||
| # next in the list. Normally run from installed system, but can also be run | ||||
| # from the base system that controls the babelbox runs. | ||||
| # It takes the top line from langlist as the next language and moves that | ||||
| # line to the bottom of the list. | ||||
| 
 | ||||
| set -e | ||||
| 
 | ||||
| ROOT="" | ||||
| 
 | ||||
| if [ -f /BABELBOX ] ; then | ||||
| 	ROOT="/mnt" | ||||
| 	sleep 30 | ||||
| 
 | ||||
| 	mount /dev/sda1 $ROOT | ||||
| fi | ||||
| 
 | ||||
| cd $ROOT/srv/babelbox | ||||
| 
 | ||||
| LANGSEL="$(egrep -v "^[[:space:]]*(#.*)?$" langlist | grep -A1 ":x:")" | ||||
| if [ -z "$LANGSEL" ]; then | ||||
| 	LANGSEL="$(head -n2 langlist)" | ||||
| fi | ||||
| if [ $(echo "$LANGSEL" | wc -l) -eq 2 ]; then | ||||
| 	LANG="$(echo "$LANGSEL" | head -n1)" | ||||
| 	NEXTLANG="$(echo "$LANGSEL" | tail -n1)" | ||||
| else | ||||
| 	# Selected language is the last in the file | ||||
| 	LANG="$LANGSEL" | ||||
| 	NEXTLANG="$(egrep -v "^[[:space:]]*(#.*)?$" langlist | head -n1)" | ||||
| fi | ||||
| 
 | ||||
| LOCALE=$(echo "$LANG" | cut -d: -f1) | ||||
| LANGNAME=$(echo "$LANG" | cut -d: -f3) | ||||
| GRUBLINE=$(echo "$LANG" | cut -d: -f4) | ||||
| 
 | ||||
| ./localize-preseed $LOCALE | ||||
| 
 | ||||
| sed -i "s/LANGNAME \".*\"/LANGNAME \"$LANGNAME\"/" preseed_early | ||||
| 
 | ||||
| sed -i "s/locale=.*$/locale=$LOCALE $GRUBLINE/ | ||||
|         s/^default[[:space:]].*$/default\t\t2/" $ROOT/boot/grub/menu.lst | ||||
| 
 | ||||
| # Comment out the next three lines if you don't want the language to change | ||||
| N_LOCALE=$(echo "$NEXTLANG" | cut -d: -f1) | ||||
| sed -i "s/:x:/::/;s/^$N_LOCALE::/$N_LOCALE:x:/" langlist | ||||
| 
 | ||||
| if [ -z "$ROOT" ]; then | ||||
| 	echo "Next language: $LANGNAME" | ||||
| fi | ||||
| 
 | ||||
| exit 0 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue