1 | #!/bin/bash |
---|
2 | |
---|
3 | export TEXTDOMAIN="zero-lliurex-pmb-installer" |
---|
4 | |
---|
5 | MSG_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.") |
---|
6 | MSG_DONE=$(gettext "Done") |
---|
7 | MSG_TITLE=$(gettext "Advertisement") |
---|
8 | MSG_AVISO=$(gettext "Your database are going to update.") |
---|
9 | MSG_NOCONFIGURE=$(gettext "No configuration done") |
---|
10 | MSG_PMB_DETECTED=$(gettext "A copy of PMB has been detected! Do you want to continue?") |
---|
11 | |
---|
12 | zero-center add-pulsating-color zero-lliurex-pmb-installer |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | # Test if a previous pmb is installed on the current systme |
---|
17 | # |
---|
18 | if [ -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 |
---|
26 | fi |
---|
27 | |
---|
28 | if zenity --question --title="$MSG_TITLE" --width=300 --height=100 --text="$MSG_ADVERTISEMENT"; then |
---|
29 | zero-installer install lliurex-pmb |
---|
30 | else |
---|
31 | zero-center remove-pulsating-color zero-lliurex-pmb-installer |
---|
32 | exit 1 |
---|
33 | fi |
---|
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 | # |
---|
39 | sudo 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. |
---|
44 | lliurex-sgbd --db_is_present lliurex-pmb |
---|
45 | if [ ! -f /tmp/db_is_present ]; then |
---|
46 | lliurex-pmb --install-database |
---|
47 | else |
---|
48 | zenity --info --text="$MSG_AVISO" |
---|
49 | lliurex-pmb --upgrade |
---|
50 | fi |
---|
51 | |
---|
52 | lliurex-pmb --hosts |
---|
53 | |
---|
54 | zero-center remove-pulsating-color zero-lliurex-pmb-installer |
---|
55 | zero-center set-configured zero-lliurex-pmb-installer |
---|
56 | |
---|
57 | exit 0 |
---|