#!/bin/bash MSG_ERROR_MYSQL=$(gettext "You must install and run mysql") ACTION="$1" PKG="$2" PKG_REPORTS="jclic-reports" case $ACTION in preInstall) apt-get install -y $PKG_REPORTS if dpkg-query -W -f'${Status}' $PKG_REPORTS 2>/dev/null | grep -q "ok installed" ; then echo "Installed, continue....."; else echo "You need jclicreports package installed in your system"; echo "Please contact with your administator system and solve this problem."; exit 1 fi ;; installPackage) #Testear el mysql echo "# Testing mysql...." RESULT=$(mysql_root_passwd -a) if [ "$RESULT" = "NO" ]; then echo "$MSG_ERROR_MYSQL" zero-center remove-pulsating-color zero-jclic exit 0 fi #Inicializar mysql echo "# Customing mysql....." mysql_root_passwd -i #Crear la base de datos y el usuario, si no existe resp=$(lliurex-sgbd --db_is_present jclic ) if [ "$resp" = "NO" ] ; then lliurex-sgbd --install jclic else lliurex-sgbd --upgrade jclic fi ;; esac exit 0