#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

xorg=`cat /proc/cmdline |awk -F 'xorg=' '{print $2}' |awk '{print $1}'`
	
	case "$xorg" in
		'800x600')
			cp /etc/X11/800x600 /etc/X11/xorg.conf
			;;
		'1024x768')
			cp /etc/X11/1024x768 /etc/X11/xorg.conf
			;;
		'installer')
			/home/minino/Apps/System/Installer/AppRun
			;;	
		*)
			cp /etc/X11/GENERIC /etc/X11/xorg.conf
			;;
	esac


lang=`cat /proc/cmdline |awk -F 'lang=' '{print $2}' |awk '{print $1}'`

	case "$lang" in
       gl)
	  LANG="gl_ES.UTF-8"
	  export LANG
          echo "LANG=\"gl_ES.UTF-8\"" > /etc/default/locale
          
          ;;
	en)
	  LANG="en_US.UTF-8"
	  export LANG
          echo "LANG=\"en_US.UTF-8\"" > /etc/default/locale

	  ;;
	es)
	  LANG="es_ES.UTF-8"
	  export LANG
          echo "LANG=\"es_ES.UTF-8\"" > /etc/default/locale

	  ;;

	*)
	  
	  ;;

	esac


dhclient3 2>/dev/null &

exit 0
