Changeset 6305


Ignore:
Timestamp:
Nov 15, 2017, 2:22:49 PM (2 years ago)
Author:
joamuran
Message:

fixed

Location:
zero-lliurex-arasuite/trunk/fuentes
Files:
5 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • zero-lliurex-arasuite/trunk/fuentes/zero-lliurex-arasuite.zmd

    r5205 r6305  
    11#!/bin/bash
    22
    3 export TEXTDOMAIN="zero-lliurex-arasuite"
     3#VARIABLES GLOBALES
    44
    5 MSG_BAJAR=$(gettext "AraSuite will now be downloaded (Aprox. Size 30MB) and installed (Aprox. Size 120MB).\n\nDuring the installation, it will ask you for the installation path (<i>/opt/AraSuite by default</i>). \n\n<b>Remember this path.</b> \n\nAfter install it, Zero Center will ask you for this path to create menu entries and perform some enhacements.")
    6 MSG_NO_INTERNET=$(gettext "No Internet Connection has been detected. Please, check it")
    7 MSG_MINUTOS=$(gettext "This operation can take a few minutes. Please wait")
    8 MSG_BAJANDO_FICHEROS=$(gettext "Necessary files are being downloaded")
    9 MSG_GENERANDO_PAQUETE=$(gettext "AraSuite package is being built up")
    10 MSG_COPIAR=$(gettext "Would you like to save a copy of *.sh for a future installation")
    11 MSG_GUARDAR=$(gettext "Choose a directory for saving the file copy")
    12 MSG_INSTALAR=$(gettext "Would you like to install AraSuite?")
    13 MSG_INSTALL_COMPLETA=$(gettext "Installation has been completed. You can access AraSuite throught Applications.")
    14 MSG_DESCARGA_COMPLETA=$(gettext "AraSuite has been successfully downloaded in /tmp, but not installed")
    15 MSG_ASK_DIR=$(gettext "We are going to create menu entries and perform some enhacements.\n\nIn which folder has been installed AraSuite?")
    16 MSG_ASK_DIR_TITLE=$(gettext "Creating Menu Entries")
    17 MSG_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")
     5PACKAGE_NAME="arasuite"
     6PACKAGE_LIST="/usr/share/zero-lliurex-arasuite/zero-lliurex-${PACKAGE_NAME}-files"
    187
    19 current_version="arasuite_unix_2_2_3.sh"
    20 url="http://sourceforge.net/projects/arasuite/files/"
    21 temp="/tmp/arasuite"
     8####MAIN
     9zero-center add-pulsating-color zero-lliurex-arasuite
    2210
    23 # Funcions per a crear els llançadors
     11zero-repos-update
     12zero-reinstall-list "$PACKAGE_LIST" "$PACKAGE_NAME"
    2413
    25 function CreateTicoLauncher {
    26     cp /var/opt/arasuite/usr/bin/template_launcher.sh /usr/bin/ticolauncher.sh
    27     echo "(cd $1/TICO && $1/TICO/TICOApp)" >> /usr/bin/ticolauncher.sh
    28 }
    29 
    30 function CreateTicoInterpreterLauncher {
    31     cp /var/opt/arasuite/usr/bin/template_launcher.sh /usr/bin/ticointerpreterlauncher.sh
    32     echo "(cd $1/TICO && $1/TICO/TICOInterpreterApp)" >> /usr/bin/ticointerpreterlauncher.sh
    33 }
    34 
    35 function CreateAraWordLauncher {
    36     cp /var/opt/arasuite/usr/bin/template_launcher.sh /usr/bin/arawordlauncher.sh
    37     echo "(cd $1/AraWord && $1/AraWord/AraWordApp)" >> /usr/bin/arawordlauncher.sh
    38 }
    39 
    40 function CreateGalleryManagerLauncher {
    41     cp /var/opt/arasuite/usr/bin/template_launcher.sh /usr/bin/gallerymanagerlauncher.sh
    42     echo "(cd $1/GalleryManager && $1/GalleryManager/GalleryManagerApp)" >> /usr/bin/gallerymanagerlauncher.sh
    43 }
    44 
    45 
    46 
    47 #COMPROBAMOS CONEXION A INTERNET
    48 zero-center add-pulsating-color zero-lliurex-arasuite
    49 rc=0
    50 zero-testnet || rc=1
    51 $(rm -R "$temp") || echo "Starting Arasuite script for donwload and install it..."
    52 if [ $rc -eq 0 ]
    53         then
    54                 zenity --info --text="$MSG_BAJAR" > /dev/null 2>&1
    55                 #axel -o $temp $url$current_version/download
    56                 zero-lliurex-wget $url$current_version $temp
    57                 #COMPRUEBO QUE EL FICHERO FUE DESCARGADO CORRECTAMENTE, ABORTANDO LA INSTALACION EN CASO CONTRARIO
    58                 if [ ! -f $temp/$current_version -o $? -ne 0 ] ; then
    59                         zenity --info --text="$current_version $MSG_NOT_ACCESIBLE" > /dev/null 2>&1 &
    60                         zero-center remove-pulsating-color zero-lliurex-arasuite
    61                         zero-center set-non-configured zero-lliurex-arasuite
    62                         exit 1
    63                 fi
    64                                        
    65                
    66         else
    67                 zenity --error --text="$MSG_NO_INTERNET"> /dev/null 2>&1 &
    68                 zero-center set-non-configured zero-lliurex-arasuite
    69                 zero-center remove-pulsating-color zero-lliurex-arasuite
    70                 exit 1
    71 fi
    72 
    73 #DESCARGAMOS FICHERO sh (.sh)
    74 flag=0
    75 
    76 lliurex-version | grep server
    77 if [ $? -eq 0 ]; then
    78         flag=1
    79 else
    80         host proxy
    81         if [ $? -ne 0 ]; then
    82                 flag=1
    83         fi
    84 fi
    85 if [ $flag -eq 0 ]; then
    86          export http_proxy="proxy:3128"
    87 fi
    88 
    89 
    90 ## PREGUNTAR SI LO QUIERE GUARDAR
    91 #if zenity --question --text="$MSG_COPIAR"; then
    92 #       RUTA=$(zenity --file-selection --directory  --text="$MSG_GUARDAR" )
    93 #       cp $temp $RUTA
    94 #fi
    95 
    96 # PREGUNTAR SI LO QUIERE INSTALAR
    97 if zenity --question --text="$MSG_INSTALAR" > /dev/null 2>&1; then
    98         chmod +x $temp/$current_version
    99         eval $temp/$current_version
    100 
    101         base_dir=`zenity --entry --entry-text '/opt/AraSuite' --text "${MSG_ASK_DIR}" --title "${MSG_ASK_DIR_TITLE}"`
    102 
    103         if [ $? -eq 0 ]; then
    104         # Create Launchers
    105         CreateTicoLauncher ${base_dir}
    106         CreateTicoInterpreterLauncher ${base_dir}
    107         CreateAraWordLauncher ${base_dir}
    108         CreateGalleryManagerLauncher ${base_dir}
    109        
    110         # Copying desktops
    111         cp /var/opt/arasuite/usr/share/applications/*.desktop /usr/share/applications/
    112        
    113         # Updating version installed
    114         PKG_VERSION=`dpkg -s zero-lliurex-arasuite | grep '^Version:' | cut -f2 -d" "`
    115         echo $PKG_VERSION > /var/opt/arasuite/installed_version
    116                
    117         # Copy locales
    118        
    119         cp /var/opt/arasuite/locales/tico.lang ${base_dir}/TICO/lang/ca_ES@valencia.lang
    120         cp /var/opt/arasuite/locales/araword.lang ${base_dir}/AraWord/lang/ca_ES@valencia.lang
    121         cp /var/opt/arasuite/locales/AWSystem.conf ${base_dir}/AraWord/conf/
    122        
    123         # Create configuration folder
    124         [[ -d ${base_dir}/.arasuite ]] || mkdir ${base_dir}/.arasuite
    125         chmod 777 ${base_dir}/.arasuite
    126        
    127         fi
    128 
    129         zenity --info --text="$MSG_INSTALL_COMPLETA" > /dev/null 2>&1 &
    130         rm -R $temp
    131 else
    132         zenity --info --text="$MSG_DESCARGA_COMPLETA" > /dev/null 2>&1 &
    133         zero-center set-non-configured zero-lliurex-arasuite
    134         zero-center remove-pulsating-color zero-lliurex-arasuite
    135         exit 1
    136 fi
    137 
    138 ##LIMPIA Y DA ESPLENDOR
    139 ##rm -f $temp
    14014zero-center remove-pulsating-color zero-lliurex-arasuite
    14115zero-center set-configured zero-lliurex-arasuite
     16
    14217exit 0
     18
Note: See TracChangeset for help on using the changeset viewer.