#!/bin/bash export TEXTDOMAIN="zero-lliurex-gearth" MSG_BAJAR=$(gettext "Google Earth will now be installed. Aprox. size 50MB") MSG_NO_INTERNET=$(gettext "No Internet Connection has been detected. Please, check it") MSG_MINUTOS=$(gettext "This operation can take a few minutes. Please wait") MSG_BAJANDO_FICHEROS=$(gettext "Necessary files are being downloaded") MSG_GENERANDO_PAQUETE=$(gettext "Google Earth package is being built up") MSG_COPIAR=$(gettext "Would you like to save a copy of *.deb for a future installation") MSG_GUARDAR=$(gettext "Choose a directory for saving the file copy") MSG_INSTALAR=$(gettext "Would you like to install Google Earth in this PC?") MSG_INSTALL_COMPLETA=$(gettext "Installation has been completed. You can access Google Earth throught Applications/Internet.") MSG_DESCARGA_COMPLETA=$(gettext "Google Earth has been successfully downloaded") MSG_INSTALL_ERROR=$(gettext "is not installed in your system, please retry again and test if you have acess to repositories in net, or contact with Lliurex Team at http://mestreacasa.gva.es/web/lliurex/forums") current_version="google-earth-stable_current_amd64.deb" url="http://dl.google.com/dl/earth/client/current/" temp="/tmp/google_temp.deb" path_name="/tmp" file_name="google_temp.deb" NAME_PACKET="google-earth-stable" zero-center add-pulsating-color zero-lliurex-gearth #COMPROBAMOS CONEXION A INTERNET zero-testnet if [ $? -eq 0 ] then zenity --info --text="$MSG_BAJAR" > /dev/null 2>&1 #axel -o $temp $url$current_version zero-lliurex-axel -u $url$current_version $path_name $file_name else zenity --error --text="$MSG_NO_INTERNET" > /dev/null 2>&1 zero-center remove-pulsating-color zero-lliurex-gearth exit 1 fi #DESCARGAMOS FICHERO BIN (.BIN) flag=0 lliurex-version | grep server #ES IMPORTANTE EXPORTAR EL PROXY PORQUE GOOGLE EARTH NO NECESITA EN SUS CONEXIONES A LA RED if [ $? -eq 0 ]; then flag=1 else host proxy if [ $? -ne 0 ]; then flag=1 fi fi if [ $flag -eq 0 ]; then export http_proxy="proxy:3128" fi # PREGUNTAR SI LO QUIERE GUARDAR if zenity --question --text="$MSG_COPIAR" > /dev/null 2>&1; then RUTA=$(zenity --file-selection --directory --text="$MSG_GUARDAR" ) cp $temp $RUTA fi # PREGUNTAR SI LO QUIERE INSTALAR if zenity --question --text="$MSG_INSTALAR" > /dev/null 2>&1; then #llamada antigua: #dpkg -i $temp zero-installer -d $temp zenity --info --text="$MSG_INSTALL_COMPLETA" > /dev/null 2>&1 else zenity --info --text="$MSG_DESCARGA_COMPLETA" > /dev/null 2>&1 fi #LIMPIA Y DA ESPLENDOR rm -f $temp #Comprueba que el paquete se instalo correctamente i="$NAME_PACKET" TEST=$( dpkg-query -s $i 2> /dev/null| grep Status | cut -d " " -f 4 ) if [ "$TEST" != 'installed' ]; then zenity --info --title="Zero-installer" --text="$PACKAGE_NAME $MSG_INSTALL_ERROR" > /dev/null 2>&1 & su -c "notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg 'Zero-Installer' '$PACKAGE_NAME $MSG_INSTALL_ERROR'" $USER zero-center remove-pulsating-color zero-lliurex-gearth zero-center set-non-configured zero-lliurex-gearth exit 1 fi zero-center remove-pulsating-color zero-lliurex-gearth zero-center set-configured zero-lliurex-gearth exit 0