Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # $Id: _install,v 0.1 2011/02/25 14:30:24 Bruno Alves y6ff $
- : ${DIALOG=dialog}
- : ${DIALOG_OK=0}
- : ${DIALOG_CANCEL=1}
- : ${DIALOG_ESC=255}
- PROGNAME=$(basename $0)
- tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/installer.$$.$RANDOM
- cleanup() {
- rm -f $tempfile
- echo "Unmounting dicas_lnx50"
- sudo umount /mnt/cdrom
- exit 1
- }
- trap "cleanup" 0 1 SIGHUP SIGINT SIGTERM
- mnt_ln50() {
- echo "Mounting dicas_lnx50 in /mnt/cdrom"
- sudo mount thera:/vol/vfinfr1/dicas_lnx50 /mnt/cdrom 2> /dev/null
- }
- usage() {
- echo "usage: $PROGNAME [[ vmware | acrobat | java ]] | [-h]]"
- echo "Or run this installer without params."
- }
- error_exit() {
- echo "${PROGNAME}: ${1:-"Unknown error"}" 1>&2
- exit 1
- }
- vrfy_dialog() {
- echo -n "Verifying dialog..."
- rpm -qi dialog &> /dev/null || yum install -y dialog &> /dev/null
- echo "OK"
- }
- inst_vmware() {
- mnt_ln50
- if [ -e /usr/bin/vmplayer ];then
- error_exit "Vmplayer já instalado."
- fi
- echo "Instalando VMWARE..."
- sudo mkdir -p /Work/VMWARE/ && chmod 1777 /Work/VMWARE/
- ssh y6ff@numenor2 "cat /imagens/VMWARE/WinXP-30GB.tgz " | tar zxvf - -C /
- scp y6ff@numenor2:/imagens/VMWARE/VMware-Workstation-Full-7.1.0-261024.$(uname -i).bundle /Work/VMWARE
- echo 'yes - no - no - enter enter enter :)'
- sudo sh /Work/VMWARE/VMware-Workstation-Full-7.1.0-261024.$(uname -i).bundle
- sudo echo "xkeymap.keycode.211 = 0x073" >> /etc/vmware/config
- sudo echo "xkeymap.usekeycodeMapIfXFree86 = true" >> /etc/vmware/config
- sudo echo -e '#!/bin/sh\n/usr/bin/vmplayer /Work/VMWARE/WinXP/WinXP.vmx 2> /dev/null &' > /usr/bin/vmp
- sudo chmod 775 /usr/bin/vmp
- echo -e "No internet explorer, configurar os sites confiáves:
- *.petrobras.com.br
- *.petrobras.biz
- Alterar configuração dentro do windows em visualizar para autosubstituir.
- Abrir imagen no cd de /usr/lib/vmware/isoimages/windows.iso para instalar o vmwaretools
- Os pacotes abaixo devem ser instalados para que o Windin funfe:
- \\infra\INFRA-TIC\ATENDIMENTO\IMAGENS\_AUTOMATIZA\Pacotes\PacoteCorporativo
- \\infra\INFRA-TIC\ATENDIMENTO\IMAGENS\_AUTOMATIZA\Pacotes\Pos-Imagem
- \\infra\INFRA-TIC\ATENDIMENTO\PROGRAMAS\Automatiza\Dominio_Automatizado
- "
- }
- inst_acrobat() {
- mnt_ln50
- echo -n "Instalando Adobe Acrobat Reader..."
- sudo rpm -ivh /mnt/cdrom/Procedimentos/AdobeReader_enu-8.1.1-1.i486.rpm || error_exit "$LINENO: Cannot install AdobeReader_enu-8.1.1-1.i486.rpm"
- echo "OK"
- }
- inst_python26() {
- mnt_ln50
- echo -n "Installing Python 2.6..."
- cd /mnt/cdrom/python26
- sudo rpm -ivh --nodeps libffi-3.0.5-1.el5.kb.x86_64.rpm python26-libs-2.6.5-2.x86_64.rpm python26-2.6.5-2.x86_64.rpm python26-docutils-0.6-1.noarch.rpm || error_exit "$LINENO: Cannot install "
- echo "OK"
- }
- menu(){
- $DIALOG --backtitle "_InstallerAPP" \
- --title "Install" --clear \
- --separate-output \
- --colors \
- --checklist "Hi, this is a installation box.\n\
- What do you like to install?" 20 61 10 \
- "Adobe acrobat reader" "Ver: 8.1.1-1" off \
- "Vmware" "Ver: 7.1.0" off \
- "Java Runtime Enviroment" "Ver:1.6.0" off \
- "Brownser" "Firefox 3.x" off \
- "Openoffice" "Free office" off \
- "ddd" "Data Display Debugger" off \
- "Scilab" "" off \
- "Octave" "" off \
- "Python 2.6" "" off \
- "Bibliotecas adicionais" "libmotif," off 2> $tempfile
- retval=$?
- choice=`cat $tempfile`
- case $retval in
- $DIALOG_OK)
- echo "$choice chosen."
- case "$choice" in
- Vmware)
- inst_vmware
- ;;
- 'Adobe acrobat reader')
- inst_acrobat
- ;;
- *)
- error_exit "APP não configurado"
- ;;
- esac
- ;;
- $DIALOG_CANCEL)
- error_exit "Cancel pressed.";;
- $DIALOG_ESC)
- error_exit "ESC pressed.";;
- *)
- echo "Unexpected return code: $retval (ok would be $DIALOG_OK)";;
- esac
- }
- ##### Main
- if [ $# -gt 0 ]; then
- vrfy_dialog
- interactive=1
- while [ "$1" != "" ]; do
- case $1 in
- vmware ) shift
- inst_vmware
- ;;
- adobe ) shift
- inst_acrobat
- ;;
- python26 ) shift
- inst_python26
- ;;
- -h | --help ) usage
- exit
- ;;
- * ) usage
- exit 1
- esac
- shift
- done
- else
- vrfy_dialog
- menu
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement