#!/bin/bash export TEXTDOMAIN="zero-lliurex-pmb-installer" 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.") MSG_DONE=$(gettext "Done") MSG_TITLE=$(gettext "Advertisement") MSG_AVISO=$(gettext "Your database are going to update.") MSG_NOCONFIGURE=$(gettext "No configuration done") MSG_PMB_DETECTED=$(gettext "A copy of PMB has been detected! Do you want to continue?") zero-center add-pulsating-color zero-lliurex-pmb-installer if [ -d /usr/share/pmb ]; then if zenity --question --title="$MSG_TITLE" --width=300 --height=100 --text="$MSG_PMB_DETECTED"; then echo "Continua l'instalació..." else zenity --info --text="$MSG_NOCONFIGURE" zero-center remove-pulsating-color zero-lliurex-pmb-installer exit 1 fi fi if zenity --question --title="$MSG_TITLE" --width=300 --height=100 --text="$MSG_ADVERTISEMENT"; then :>/tmp/lliurex-pmb-packet echo "lliurex-pmb install" >> /tmp/lliurex-pmb-packet apt-get update synaptic --hide-main-window --non-interactive --set-selections-file /tmp/lliurex-pmb-packet dpkg -l | grep " lliurex-pmb " | grep ii if [ $? -ne 0 ]; then zero-center remove-pulsating-color zero-lliurex-pmb-installer exit 1 fi else exit 1 fi resp=$(lliurex-sgbd --db_is_present lliurex-pmb) if [ "$resp" = "NO" ] ; then lliurex-pmb --install-database else zenity --info --text="$MSG_AVISO" lliurex-pmb --upgrade fi lliurex-pmb --hosts zero-center remove-pulsating-color zero-lliurex-pmb-installer zero-center set-configured zero-lliurex-pmb-installer exit 0