source: zero-lliurex-gearth/trunk/fuentes/zero-lliurex-gearth.amd64.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
18current_version="google-earth-stable_current_amd64.deb"
19url="http://dl.google.com/dl/earth/client/current/"
20temp="/tmp/google_temp.deb"
21path_name="/tmp"
22file_name="google_temp.deb"
23PACKAGE_NAME="google-earth-pro-stable"
24GEARTH_REPO_FILE="/etc/apt/sources.list.d/google-earth.list"
25
26zero-center add-pulsating-color zero-lliurex-gearth
27
28#COMPROBAMOS CONEXION A INTERNET
29
30zero-testnet
31if [ $? -eq 0 ]
32        then
33                zenity --info --text="$MSG_BAJAR" > /dev/null 2>&1
34                #axel -o $temp $url$current_version
35                zero-lliurex-axel -u $url$current_version $path_name $file_name
36        else
37                zenity --error --text="$MSG_NO_INTERNET" > /dev/null 2>&1
38                zero-center remove-pulsating-color zero-lliurex-gearth
39                exit 1
40fi
41
42#DESCARGAMOS FICHERO BIN (.BIN)
43flag=0
44
45# COMPROBAMOS SI EL FICHERO SE HA DESCARGADO
46if [ ! -f $temp ]; then
47                zenity --info --text="$MSG_CANCELLED" >/dev/null 2>&1
48                zero-center remove-pulsating-color zero-lliurex-gearth
49                exit 1
50fi     
51       
52
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
87
88desktop_path="/usr/share/mate/applications/google-earth.desktop"
89
90#Comprueba que el paquete se instalo correctamente
91i="$PACKAGE_NAME"
92echo $i
93TEST=$( dpkg-query -s $i 2> /dev/null| grep Status | cut -d " " -f 4 )
94                if [ "$TEST" != 'installed' ]; then
95                        zenity --info --title="Zero-installer" --text="$PACKAGE_NAME $MSG_INSTALL_ERROR" > /dev/null 2>&1 &
96                        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
97                        zero-center remove-pulsating-color zero-lliurex-gearth
98                        zero-center set-non-configured zero-lliurex-gearth
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
110               
111zero-center remove-pulsating-color zero-lliurex-gearth
112zero-center set-configured zero-lliurex-gearth
113
114
115exit 0
Note: See TracBrowser for help on using the repository browser.