source: zero-lliurex-pmb-installer/trunk/fuentes/zero-lliurex-pmb-installer.zlaunchers/zero-lliurex-pmb-installer.zmd @ 340

Last change on this file since 340 was 340, checked in by jrpelegrina, 5 years ago

First release to xenial

File size: 1.8 KB
Line 
1#!/bin/bash
2
3export TEXTDOMAIN="zero-lliurex-pmb-installer"
4
5MSG_ADVERTISEMENT=$(gettext "You are going to install PMB \\nIt includes mysql, http, php and others, if needs.\\n It will take a long time.\\n Be patient.")
6MSG_DONE=$(gettext "Done")
7MSG_TITLE=$(gettext "Advertisement")
8MSG_AVISO=$(gettext "Your database are going to update.")
9MSG_NOCONFIGURE=$(gettext "No configuration done")
10MSG_PMB_DETECTED=$(gettext "A copy of PMB has been detected! Do you want to continue?")
11
12zero-center add-pulsating-color zero-lliurex-pmb-installer
13
14
15
16# Test if a previous pmb is installed on the current systme
17#
18if [ -d /usr/share/pmb ]; then
19        if zenity --question --title="$MSG_TITLE" --width=300 --height=100 --text="$MSG_PMB_DETECTED"; then
20                echo "Continua l'instalació..."
21        else
22                zenity --info --text="$MSG_NOCONFIGURE"
23                zero-center remove-pulsating-color zero-lliurex-pmb-installer
24                exit 1
25        fi
26fi
27
28if zenity --question --title="$MSG_TITLE" --width=300 --height=100 --text="$MSG_ADVERTISEMENT"; then
29        zero-installer install lliurex-pmb
30else
31        zero-center remove-pulsating-color zero-lliurex-pmb-installer
32        exit 1
33fi
34
35# Testing it MySQL is alive and the root passwd is available
36# "sudo" is mandatory here, I don't understand the correct reason...
37# if you are reading this comment, and know the answer...please contact with us
38#
39sudo mysql_root_passwd -i
40
41# Since the 0.61 version, which is required by lliurex-pmb the lliurex-sgbd utility uses
42# a simple mechanism to create a token in /tmp/db_is_present , a more useful mechanism that "NO"
43# at STDOUT. 
44lliurex-sgbd --db_is_present lliurex-pmb
45if [ ! -f /tmp/db_is_present ]; then
46        lliurex-pmb --install-database
47else
48        zenity --info --text="$MSG_AVISO"
49        lliurex-pmb --upgrade
50fi
51
52lliurex-pmb --hosts
53
54zero-center remove-pulsating-color zero-lliurex-pmb-installer
55zero-center set-configured zero-lliurex-pmb-installer
56
57exit 0
Note: See TracBrowser for help on using the repository browser.