source: zero-lliurex-arasuite/trunk/fuentes/zero-lliurex-arasuite.zmd @ 1651

Last change on this file since 1651 was 1651, checked in by daduve, 3 years ago

Add zero-lliurex-wget to zmd

File size: 7.4 KB
Line 
1#!/bin/bash
2
3export TEXTDOMAIN="zero-lliurex-arasuite"
4
5MSG_BAJAR=$(gettext "AraSuite will now be downloaded (Aprox. Size 30MB) and installed (Aprox. Size 120MB)")
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 "AraSuite package is being built up")
10MSG_COPIAR=$(gettext "Would you like to save a copy of *.sh for a future installation")
11MSG_GUARDAR=$(gettext "Choose a directory for saving the file copy")
12MSG_INSTALAR=$(gettext "Would you like to install AraSuite?")
13MSG_INSTALL_COMPLETA=$(gettext "Installation has been completed. You can access AraSuite throught Applications.")
14MSG_DESCARGA_COMPLETA=$(gettext "AraSuite has been successfully downloaded in /tmp, but not installed")
15MSG_ASK_DIR=$(gettext "In which folder has been installed AraSuite? \n(Ask Cancel if you don't want to create Menu Entries)")
16MSG_ASK_DIR_TITLE=$(gettext "Creating Menu Entries")
17MSG_NOT_ACCESIBLE=$(gettext "file isn\'t accesible at the moment, because you cancel the download or other reasons. You can retry to install it again or report your problem to Lliurex Team in http://mestreacasa.gva.es/web/lliurex/forums")
18
19current_version="arasuite_unix_2_2_1.sh"
20url="http://sourceforge.net/projects/arasuite/files/"
21temp="/tmp/arasuite"
22
23# Funcions per a crear els desktops
24
25function CreateTicoDesktop {
26    echo "[Desktop Entry]" > /usr/share/applications/tico.desktop
27    echo "Version=1.0" >> /usr/share/applications/tico.desktop
28    echo "Encoding=UTF-8" >> /usr/share/applications/tico.desktop
29    echo "Name=Tico" >> /usr/share/applications/tico.desktop
30    echo "Comment=Interactive Grid Editor" >> /usr/share/applications/tico.desktop
31    echo "Comment[es]=Editor de tableros interactivos" >> /usr/share/applications/tico.desktop
32    echo "Comment[qcv]=Editor de taulers interactius" >> /usr/share/applications/tico.desktop
33    echo "Comment[ca]=Editor de taulers interactius" >> /usr/share/applications/tico.desktop
34    echo "Path=$1/TICO" >> /usr/share/applications/tico.desktop
35    echo "TryExec=$1/TICO/TICOApp" >> /usr/share/applications/tico.desktop
36    echo "Exec=$1/TICO/TICOApp" >> /usr/share/applications/tico.desktop
37    echo "Terminal=false" >> /usr/share/applications/tico.desktop
38    echo "Icon=tico" >> /usr/share/applications/tico.desktop
39    echo "Type=Application" >> /usr/share/applications/tico.desktop
40    echo "GenericName=Tico" >> /usr/share/applications/tico.desktop
41    echo "Categories=Education;" >> /usr/share/applications/tico.desktop
42}
43
44function CreateAraWordDesktop {
45    echo "[Desktop Entry]" > /usr/share/applications/araword.desktop
46    echo "Version=1.0" >> /usr/share/applications/araword.desktop
47    echo "Encoding=UTF-8" >> /usr/share/applications/araword.desktop
48    echo "Name=AraWord" >> /usr/share/applications/araword.desktop
49    echo "Comment=Pictogram Text Editor" >> /usr/share/applications/araword.desktop
50    echo "Comment[es]=Editor de textos con pictogramas" >> /usr/share/applications/araword.desktop
51    echo "Comment[qcv]=Editor de textos amb pictogrames" >> /usr/share/applications/araword.desktop
52    echo "Comment[ca]=Editor de textos amb pictogrames" >> /usr/share/applications/araword.desktop
53    echo "Path=$1/AraWord" >> /usr/share/applications/araword.desktop
54    echo "TryExec=$1/AraWord/AraWordApp" >> /usr/share/applications/araword.desktop
55    echo "Exec=$1/AraWord/AraWordApp" >> /usr/share/applications/araword.desktop
56    echo "Terminal=false" >> /usr/share/applications/araword.desktop
57    echo "Icon=araword" >> /usr/share/applications/araword.desktop
58    echo "Type=Application" >> /usr/share/applications/araword.desktop
59    echo "GenericName=AraWord" >> /usr/share/applications/araword.desktop
60    echo "Categories=Education;" >> /usr/share/applications/araword.desktop
61
62}
63
64function CreateGalleryManagerDesktop {
65    echo "[Desktop Entry]" > /usr/share/applications/gallerymanager.desktop
66    echo "Version=1.0" >> /usr/share/applications/gallerymanager.desktop
67    echo "Encoding=UTF-8" >> /usr/share/applications/gallerymanager.desktop
68    echo "Name=GalleryManager" >> /usr/share/applications/gallerymanager.desktop
69    echo "Comment=Pictogram Gallery Manager" >> /usr/share/applications/gallerymanager.desktop
70    echo "Comment[es]=Admiministra la galeria de pictogramas" >> /usr/share/applications/gallerymanager.desktop
71    echo "Comment[qcv]=Administra la galeria de pictogrames" >> /usr/share/applications/gallerymanager.desktop
72    echo "Comment[ca]=Administra la galeriad de pictogrames" >> /usr/share/applications/gallerymanager.desktop
73    echo "Path=$1/GalleryManager" >> /usr/share/applications/gallerymanager.desktop
74    echo "TryExec=$1/GalleryManager/GalleryManagerApp" >> /usr/share/applications/gallerymanager.desktop
75    echo "Exec=$1/GalleryManager/GalleryManagerApp" >> /usr/share/applications/gallerymanager.desktop
76    echo "Terminal=false" >> /usr/share/applications/gallerymanager.desktop
77    echo "Icon=arasuite" >> /usr/share/applications/gallerymanager.desktop
78    echo "Type=Application" >> /usr/share/applications/gallerymanager.desktop
79    echo "GenericName=GalleryManager" >> /usr/share/applications/gallerymanager.desktop
80    echo "Categories=Education;" >> /usr/share/applications/gallerymanager.desktop
81
82}
83
84
85
86
87
88
89#COMPROBAMOS CONEXION A INTERNET
90zero-center add-pulsating-color zero-lliurex-arasuite
91rc=0
92zero-testnet || rc=1
93$(rm -R "$temp") || echo "Starting Arasuite script for donwload and install it.........."
94if [ $rc -eq 0 ]
95        then
96                #zenity --info --timeout 3 --text="$MSG_BAJAR" > /dev/null 2>&1 &
97                #axel -o $temp $url$current_version/download
98                zero-lliurex-wget $url$current_version $temp
99                #COMPRUEBO QUE EL FICHERO FUE DESCARGADO, ABORTANDO LA INSTALACION EN CASO CONTRARIO
100                if [ ! -f $temp/$current_version ] ; then
101                        zenity --info --text="$current_version $MSG_NOT_ACCESIBLE" > /dev/null 2>&1 &
102                        zero-center remove-pulsating-color zero-lliurex-arasuite
103                        zero-center set-non-configured zero-lliurex-arasuite
104                        exit 1
105                fi
106                                       
107               
108        else
109                zenity --error --text="$MSG_NO_INTERNET"> /dev/null 2>&1 &
110                zero-center set-non-configured zero-lliurex-arasuite
111                zero-center remove-pulsating-color zero-lliurex-arasuite
112                exit 1
113fi
114
115#DESCARGAMOS FICHERO sh (.sh)
116flag=0
117
118lliurex-version | grep server
119if [ $? -eq 0 ]; then
120        flag=1
121else
122        host proxy
123        if [ $? -ne 0 ]; then
124                flag=1
125        fi
126fi
127if [ $flag -eq 0 ]; then
128         export http_proxy="proxy:3128"
129fi
130
131
132## PREGUNTAR SI LO QUIERE GUARDAR
133#if zenity --question --text="$MSG_COPIAR"; then
134#       RUTA=$(zenity --file-selection --directory  --text="$MSG_GUARDAR" )
135#       cp $temp $RUTA
136#fi
137
138# PREGUNTAR SI LO QUIERE INSTALAR
139if zenity --question --text="$MSG_INSTALAR" > /dev/null 2>&1; then
140        chmod +x $temp/$current_version
141        eval $temp/$current_version
142
143        base_dir=`zenity --entry --entry-text '/opt/AraSuite' --text "${MSG_ASK_DIR}" --title "${MSG_ASK_DIR_TITLE}"`
144
145        if [ $? -eq 0 ]; then
146                CreateTicoDesktop ${base_dir}
147                CreateAraWordDesktop ${base_dir}
148                CreateGalleryManagerDesktop ${base_dir}
149        fi
150
151        zenity --info --text="$MSG_INSTALL_COMPLETA" > /dev/null 2>&1 &
152        rm -R $temp
153else
154        zenity --info --text="$MSG_DESCARGA_COMPLETA" > /dev/null 2>&1 &
155        zero-center set-non-configured zero-lliurex-arasuite
156        zero-center remove-pulsating-color zero-lliurex-arasuite
157        exit 1
158fi
159
160##LIMPIA Y DA ESPLENDOR
161##rm -f $temp
162zero-center remove-pulsating-color zero-lliurex-arasuite
163zero-center set-configured zero-lliurex-arasuite
164exit 0
Note: See TracBrowser for help on using the repository browser.