- Timestamp:
- 05/17/12 12:59:31 (12 years ago)
- Location:
- trunk/INSTALL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/INSTALL/arquivos/scripts/aux.sh
r6207 r6219 49 49 } 50 50 51 # Detects which OS and if it is Linux then it will detect which Linux 52 # Distribution. 53 # http://linuxmafia.com/faq/Admin/release-files.html 54 msg_erro () 55 { 56 echo "Sistema operacional ($1) não suportado!" 57 exit 1 58 } 59 60 qualSO () 61 { 62 OS=`uname -s` 63 REV=`uname -r` 64 MACH=`uname -m` 65 66 DIST="Desconhecido" 67 PSEUDONAME="Desconhecido" 68 REV="Desconhecido" 69 70 if [ "${OS}" = "SunOS" ] ; then 71 OS=Solaris 72 ARCH=`uname -p` 73 OSSTR="${OS} ${REV}(${ARCH} `uname -v`)" 74 msg_erro $OSSTR 75 elif [ "${OS}" = "AIX" ] ; then 76 OSSTR="${OS} `oslevel` (`oslevel -r`)" 77 msg_erro $OSSTR 78 elif [ "${OS}" = "Linux" ] ; then 79 KERNEL=`uname -r` 80 # RedHat ou Centos 81 if [ -f /etc/redhat-release ] ; then 82 DIST=`cat /etc/redhat-release | cut -d' ' -f1` 83 PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` 84 REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` 85 # Debian, Ubuntu e variantes, que possuem o LSB 86 elif [ -f /etc/debian_version ] ; then 87 DIST=`lsb_release -si` 88 PSEUDONAME=`lsb_release -sc` 89 REV=`lsb_release -sr` 90 # TODO: Validar do suse 91 elif [ -f /etc/SuSE-release ] ; then 92 DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//` 93 REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //` 94 fi 95 96 OSSTR="${OS} ${DIST} ${REV} (${PSEUDONAME} ${KERNEL} ${MACH})" 97 fi 98 } 99 100 validaSO () 101 { 102 R=1 103 #if [ "$DIST" == "$1" ] && [ `echo $REV | grep -q "$2"` ] 104 echo $REV | grep -q "$2" 105 if [ $? -eq 0 ] && [ "$DIST" == "$1" ] 106 then 107 R=0 108 fi 109 110 return $R 111 } -
trunk/INSTALL/expressoInstall.sh
r6207 r6219 47 47 [ $UID != 0 ] && { echo "Este script deve ser executado como superusuario (root) ou com sudo"; exit 1; } 48 48 49 # Instala o dialog50 # Se o arquivo existir, eh Debian ou variante ( ls /etc/*[-_]{release,version} )51 if [ -f /etc/lsb-release ]52 then53 apt-get -y install dialog || { echo "Falha ao instalar o dialog! Por favor, instale manualmente."; exit 1; }54 else55 yum -y install dialog || { echo "Falha ao instalar o dialog! Por favor, instale manualmente."; exit 1; }56 fi57 49 58 50 # Telas da instalacao … … 72 64 dialog --backtitle "$BACKTITLE" --cr-wrap --yesno "$INTRO" 18 80 || exit 0 73 65 74 # Menu de selecao do SO 75 SO=$( dialog --backtitle "$BACKTITLE" --stdout --menu 'Em qual sistema operacional (SO) o ExpressoLivre será instalado?' 13 70 10 \ 76 rhel6 'GNU/Linux Red Hat (v6.x) ou CentOS (v6.x)' \ 77 debian-squeeze 'GNU/Linux Debian Squeeze (v6.x)' \ 78 ubuntu-11.10 'GNU/Linux Ubuntu Server (11.10)' ) 79 80 # TODO: Precio de ajuda para implementar e testar nestas distros 81 #sles10 'GNU/Linux SuSe Enterprise Linux (v10.x)' \ 82 #sles11 'GNU/Linux SuSe Enterprise Linux (v11.x)' \ 66 # Identifica o SO 67 qualSO 68 # Verifica se o SO eh compativel com o instalador 69 if ( validaSO "Debian" "6.0" ) 70 then 71 INSTALL="debian-squeeze" 72 elif ( validaSO "Ubuntu" "11.10" ) 73 then 74 INSTALL="ubuntu-11.10" 75 elif ( validaSO "CentOS" "6." || validaSO "RedHat" "6." ) 76 then 77 INSTALL="rhel6" 78 else 79 echo "Sistema operacional desconhecido ou incompativel com o instalador do Expresso Livre!" 80 echo "$OSSTR" 81 echo "Por favor, utilize uma distribuição GNU/Linux compatÃvel: Debian 6.x, Ubuntu 11.10 ou CentOS/RedHat 6.x" 82 exit 1 83 fi 83 84 84 BACKTITLE="$BACKTITLE, para $ SO"85 BACKTITLE="$BACKTITLE, para $INSTALL" 85 86 86 87 # Inicializacao basica de instalacao, como atualização de repositório e criação de variáveis de ambiente 87 ini_$ SO88 ini_$INSTALL 88 89 89 90 # Inicia a escolha/instalacao e configuracao dos servicos nessarios ao ExpressoLivre … … 99 100 for I in $SERVICOS 100 101 do 101 $I\_$ SO102 $I\_$INSTALL 102 103 done 103 104
Note: See TracChangeset
for help on using the changeset viewer.