source: zero-lliurex-gearth/trunk/fuentes/zero-lliurex-gearth.i386.zmd @ 5754

Last change on this file since 5754 was 5754, checked in by jrpelegrina, 3 years ago

WIP in changes for new version of google-earth

File size: 3.8 KB
Line 
1#!/bin/bash
2
3export TEXTDOMAIN="zero-lliurex-gearth"
4
5MSG_BAJAR=$(gettext "Google Earth will now be installed. Aprox. size 50MB")
6MSG_NO_INTERNET=$(gettext "No Internet Connection has been detected. Please, check it")
7MSG_MINUTOS=$(gettext "This operation can take a few minutes. Please wait")
8MSG_BAJANDO_FICHEROS=$(gettext "Necessary files are being downloaded")
9MSG_GENERANDO_PAQUETE=$(gettext "Google Earth package is being built up")
10MSG_COPIAR=$(gettext "Would you like to save a copy of *.deb for a future installation")
11MSG_GUARDAR=$(gettext "Choose a directory for saving the file copy")
12MSG_INSTALAR=$(gettext "Would you like to install Google Earth in this PC?")
13MSG_INSTALL_COMPLETA=$(gettext "Installation has been completed. You can access Google Earth throught Applications/Internet.")
14MSG_DESCARGA_COMPLETA=$(gettext "Google Earth has been successfully downloaded")
15MSG_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")
16MSG_CANCELLED=$(gettext "Your dowloading has been cancel. Google Earth will not be installed in your system ")
17
18
19current_version="google-earth-stable_current_i386.deb"
20url="http://dl.google.com/dl/earth/client/current/"
21temp="/tmp/google_temp.deb"
22path_name="/tmp"
23file_name="google_temp.deb"
24PACKAGE_NAME="google-earth-pro-stable"
25GEARTH_REPO_FILE="/etc/apt/sources.list.d/google-earth.list"
26
27
28zero-center add-pulsating-color zero-lliurex-gearth
29
30#COMPROBAMOS CONEXION A INTERNET
31
32zero-testnet
33if [ $? -eq 0 ]
34        then
35                zenity --info --text="$MSG_BAJAR" > /dev/null 2>&1
36                #axel -o $temp $url$current_version
37                zero-lliurex-axel -u $url$current_version $path_name $file_name
38        else
39                zenity --error --text="$MSG_NO_INTERNET" > /dev/null 2>&1
40                zero-center remove-pulsating-color zero-lliurex-gearth
41                exit 1
42fi
43
44#DESCARGAMOS FICHERO BIN (.BIN)
45flag=0
46
47# COMPROBAMOS SI EL FICHERO SE HA DESCARGADO
48if [ ! -f $temp ]; then
49                zenity --info --text="$MSG_CANCELLED" >/dev/null 2>&1
50                zero-center remove-pulsating-color zero-lliurex-gearth
51                exit 1
52fi     
53
54lliurex-version | grep server
55#ES IMPORTANTE EXPORTAR EL PROXY PORQUE GOOGLE EARTH NO NECESITA EN SUS CONEXIONES A LA RED
56if [ $? -eq 0 ]; then
57        flag=1
58else
59        host proxy
60        if [ $? -ne 0 ]; then
61                flag=1
62        fi
63fi
64
65if [ $flag -eq 0 ]; then
66         export http_proxy="proxy:3128"
67fi
68
69
70# PREGUNTAR SI LO QUIERE GUARDAR
71if zenity --question --text="$MSG_COPIAR" > /dev/null 2>&1; then
72        RUTA=$(zenity --file-selection --directory  --text="$MSG_GUARDAR" )
73        cp $temp $RUTA
74fi
75# PREGUNTAR SI LO QUIERE INSTALAR
76if zenity --question --text="$MSG_INSTALAR" > /dev/null 2>&1; then
77        #llamada antigua:
78        #dpkg -i $temp
79        zero-installer -d $temp
80        zenity --info --text="$MSG_INSTALL_COMPLETA" > /dev/null 2>&1
81else
82        zenity --info --text="$MSG_DESCARGA_COMPLETA" > /dev/null 2>&1
83fi
84
85#LIMPIA Y DA ESPLENDOR
86rm -f $temp
87desktop_path="/usr/share/mate/applications/google-earth.desktop"
88
89
90#Comprueba que el paquete se instalo correctamente
91i="$PACKAGE_NAME"
92TEST=$( dpkg-query -s $i 2> /dev/null| grep Status | cut -d " " -f 4 )
93                if [ "$TEST" != 'installed' ]; then
94                        zenity --info --title="Zero-installer" --text="$PACKAGE_NAME $MSG_INSTALL_ERROR" > /dev/null 2>&1 &
95                        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
96                        zero-center remove-pulsating-color zero-lliurex-gearth
97                        zero-center set-non-configured zero-lliurex-gearth
98                        exit 1         
99                                exit 1         
100                else
101                        #Elimino el desktop para utilizar el proporcionado por lliurex-desktops-keeper
102                        if [ -f $desktop_path ]; then
103                                rm -f $desktop_path
104                        fi     
105                fi
106
107                if [ -f $GEARTH_REPO_FILE ]; then
108                        rm -f $GEARTH_REPO_FILE
109                fi
110zero-center remove-pulsating-color zero-lliurex-gearth
111zero-center set-configured zero-lliurex-gearth
112
113
114exit 0
Note: See TracBrowser for help on using the repository browser.