source: zero-lliurex-sketchup/trunk/fuentes/zero-lliurex-sketchup.zlaunchers/zero-lliurex-sketchup.zmd @ 279

Last change on this file since 279 was 279, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 4.1 KB
Line 
1#!/bin/bash
2
3export TEXTDOMAIN="zero-lliurex-sketchup"
4MSG_NO_INTERNET=$(gettext "No Internet Connection has been detected. Please, check it")
5MSG_BAJAR=$(gettext "Google Sketchup will now be downloaded. Aprox. size 38,6MB")
6MSG_CANCEL_DOWNLOADED="Your downloading for GoogleSketchup was cancelled, if you want install it restart the process again. If the error persist contact with Lliurex Team at http://mestreacasa.gva.es/web/lliurex/forums"
7TEST_FILE="/tmp/wget.test"
8URL_TEST="http://www.lliurex.net/recursos/wget.test"
9URL_EXE="http://dl.google.com/sketchup/GoogleSketchUpWES.exe"
10
11if [ -e $TEST_FILE ]; then
12        rm -rf $TEST_FILE
13fi
14zero-center add-pulsating-color zero-lliurex-sketchup
15#Comprobar conexión a internet e instalar
16rc=0
17zero-testnet|| rc=1
18if [ $rc -eq 0 ]
19        then
20        zenity --info --text="$MSG_BAJAR"
21        #su $USER -c "wget -O /tmp/wget.test http://www.lliurex.net/recursos/wget.test --tries=2 --timeout=5"
22        su $USER -c "zero-lliurex-axel -u '$URL_TEST' /tmp"
23                if [ $? != "0" ]; then 
24                        echo "Your downloading for GoogleSketchup was cancelled, if you want install it restart the process again. If the error persist contact with Lliurex Team at http://mestreacasa.gva.es/web/lliurex/forums"
25                        notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg "Zero-GoogleSketchUp" "$MSG_CANCEL_DOWNLOADED"
26                        zenity --info --text="$MSG_CANCEL_DOWNLOADED" &
27                        zero-center remove-pulsating-color zero-lliurex-sketchup
28                        exit 1
29                fi
30        if [ -e $TEST_FILE ]; then
31
32                #su $USER -c "wget -O /tmp/GoogleSketchUpWES.exe http://dl.google.com/sketchup/GoogleSketchUpWES.exe -c"
33                su $USER -c "zero-lliurex-axel -u '$URL_EXE' /tmp"
34                if [ $? != "0" ]; then 
35                        echo "Your downloading for GoogleSketchup was cancelled, if you want install it restart the process again. If the error persist contact with Lliurex Team at http://mestreacasa.gva.es/web/lliurex/forums"
36                        notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg "Zero-GoogleSketchUp" "$MSG_CANCEL_DOWNLOADED"
37                        zenity --info --text="$MSG_CANCEL_DOWNLOADED" &
38                        zero-center remove-pulsating-color zero-lliurex-sketchup
39                        exit 1
40                fi
41               
42        else
43                export http_proxy="http://proxy:3128"
44                #su $USER -c "wget -O /tmp/test http://www.lliurex.net/recursos/wget.test"
45                su $USER -c "zero-lliurex-axel '$URL_TEST' /tmp"
46                if [ $? != "0" ]; then 
47                        echo "Your downloading for GoogleSketchup was cancelled, if you want install it restart the process again. If the error persist contact with Lliurex Team at http://mestreacasa.gva.es/web/lliurex/forums"
48                        notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg "Zero-GoogleSketchUp" "$MSG_CANCEL_DOWNLOADED"
49                        zenity --info --text="$MSG_CANCEL_DOWNLOADED" &
50                        zero-center remove-pulsating-color zero-lliurex-sketchup
51                        exit 1
52                fi
53                if [ -e $TEST_FILE ]; then
54                        #su $USER -c "wget -O /tmp/GoogleSketchUpWES.exe http://dl.google.com/sketchup/GoogleSketchUpWES.exe -c"
55                        su $USER -c "zero-lliurex-axel '$URL_EXE' /tmp"
56                        if [ $? != "0" ]; then 
57                        echo "Your downloading for GoogleSketchup was cancelled, if you want install it restart the process again. If the error persist contact with Lliurex Team at http://mestreacasa.gva.es/web/lliurex/forums"
58                        notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg "Zero-GoogleSketchUp" "$MSG_CANCEL_DOWNLOADED"
59                        zenity --info --text="$MSG_CANCEL_DOWNLOADED" &
60                        zero-center remove-pulsating-color zero-lliurex-sketchup
61                        exit 1
62                fi
63                else
64                        zenity --error --text="$MSG_NO_INTERNET" &
65                        zero-center remove-pulsating-color zero-lliurex-sketchup
66                        exit 1
67                fi
68        fi
69else
70        zenity --error --text="$MSG_NO_INTERNET" &
71        zero-center remove-pulsating-color zero-lliurex-sketchup
72        zero-center set-non-configured zero-lliurex-sketchup
73        exit 1
74fi
75
76
77su $USER -c "wine /tmp/GoogleSketchUpWES.exe"
78#Modificar una entrada del registro a 1, mediante el fichero /usr/share/google-sketchup/hw_ok_set.reg
79su $USER -c "regedit /usr/share/google-sketchup/hw_ok_set.reg"
80
81zero-center remove-pulsating-color zero-lliurex-sketchup
82zero-center set-configured zero-lliurex-sketchup
83
84exit 0
Note: See TracBrowser for help on using the repository browser.