source: jclic/trunk/fuentes/debian/zero-jclic/usr/share/zero-center/zmds/zero-jclic.zmd @ 3466

Last change on this file since 3466 was 3466, checked in by Juanma, 4 years ago

Updated to 3.2.1

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/bash
2
3export TEXTDOMAIN="zero-jclic"
4MSG_ERROR_MYSQL=$(gettext "You must install and run mysql")
5MSG_NOCONFIGURE=$(gettext "Leaving unconfigured")
6MSG_PASSWD=$(gettext "Administrator password for Jclic Reports: /etc/lliurex-sgbd/jclic.sgbd")
7PACKAGE="lliurex-sgbd"
8
9
10function test_install {
11                #Testeamos si el paquete esta instalado, no haciendo nada en el caso afirmativo o instalandolo en el caso negativo.
12                TEST=$( dpkg-query -s $1 2> /dev/null| grep Status | cut -d " " -f 4 )
13                if [ "$TEST" = 'installed' ]; then
14                        echo "Package $1 already installed, we have to uninstall it"
15                        su -c "notify-send -t 2000 -u critical -i /usr/share/icons/lliurex-neu/scalable/apps/zero-center.svg 'Zero-Installer' '$1 is already installed in your system, now we are goig to remove it and install it again.'" $USER
16                        zero-installer remove $1
17                fi
18
19        }
20
21
22
23##############################MAIN###########################
24
25zero-center add-pulsating-color zero-jclic
26
27(
28echo "# Updating Repositories...."
29zero-repos-update
30echo "20"
31echo "Testing if package was installed in your system"
32test_install "$PACKAGE"
33echo "30"
34echo "# Installing lliurex-sgbd...."
35zero-installer install "$PACKAGE"
36
37
38
39if [ $? -ne 0 ]; then
40        zenity --info --text="$MSG_NOCONFIGURE"
41        zero-center remove-pulsating-color zero-jclic
42        exit 0
43fi
44
45#Testear el mysql
46echo "40"
47echo "# Testing mysql...."
48RESULT=$(mysql_root_passwd -a)
49if [ "$RESULT" = "NO" ]; then
50        zenity --error --text "$MSG_ERROR_MYSQL"
51        zero-center remove-pulsating-color zero-jclic
52        exit 0
53fi
54
55#Inicializar mysql
56echo "60"
57echo "# Customing mysql....."
58mysql_root_passwd -i
59
60#Crear la base de datos y el usuario, si no existe
61resp=$(lliurex-sgbd --db_is_present jclic )
62if [ "$resp" = "NO" ] ; then
63        lliurex-sgbd --install jclic
64else
65        lliurex-sgbd --upgrade jclic
66fi
67
68#Crear un fichero de inicialización
69echo "80"
70echo "# Executing last scripts......."
71touch /etc/.jclic.conf
72cat > /etc/.jclic.conf << EOF
73*********************************************
74Creado al configurar con zero-center el jclic
75*********************************************
76EOF
77sleep 1
78) | zenity --progress --title="Jclic Report Server" --percentage=0 --auto-close --auto-kill --width="500" --no-cancel
79
80
81zenity --warning --text="$MSG_PASSWD" &
82
83#Deshabilitar después de configurar
84zero-center remove-pulsating-color zero-jclic
85zero-center set-configured zero-jclic
86
87exit 0
Note: See TracBrowser for help on using the repository browser.