Changeset 3605


Ignore:
Timestamp:
Feb 13, 2017, 4:53:13 PM (3 years ago)
Author:
mabarracus
Message:

Fix debian scripts

Location:
lliurex-analytics-server/trunk/fuentes/debian
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/debian/changelog

    r3551 r3605  
     1lliurex-analytics-server (0.1.3) xenial; urgency=medium
     2
     3  * Fix debian scripts
     4
     5 -- M.Angel Juan <m.angel.juan@gmail.com>  Mon, 13 Feb 2017 16:23:13 +0100
     6
    17lliurex-analytics-server (0.1.2) xenial; urgency=medium
    28
  • lliurex-analytics-server/trunk/fuentes/debian/postinst

    r3377 r3605  
    1 #!/bin/bash
     1#!/bin/sh
    22# postinst script
    33#
    44# see: dh_installdeb(1)
    55
    6 #set -e
    7 
    8 . /usr/share/debconf/confmodule
     6set -e
     7# AVOID DECOMENT WITHOUT DEBCONF QUESTIONS
     8#. /usr/share/debconf/confmodule
    99
    1010# summary of how this script can be called:
     
    5252            PASS=$(cat /etc/lliurex-analytics-server/config_db|perl -ne '/pass=(.*)/i && print $1')
    5353            if [ -n "${USER}" -a -n "${PASS}" ]; then
    54                 RES=$(echo 'show tables;'|mysql -u${USER} -p${PASS} -s analytics 2>/dev/null)
     54                RES=$(echo 'show tables;'|mysql -u${USER} -p${PASS} -s analytics 2>/dev/null || true)
    5555                if [ -n "${RES}" ]; then
    5656                    user="${USER}"
     
    7777    if [ "${ASK}" = "yes" ]; then
    7878        ask_question 'Desea configurar la base de datos analytics?'
    79         if [ "x$input" == "xyes" ]; then
     79        if [ "x$input" = "xyes" ]; then
    8080            create_db=$input
    8181            ask_question 'Desea crear usuario para la tabla de la base de datos?'
    8282            create_user=$input
    83             if [ "x$input" == "xyes" ]; then
     83            if [ "x$input" = "xyes" ]; then
    8484                do_dialog 'Database configuration' 'Nombre del usuario para crear:'
    8585                user=$input
     
    106106#INITIALIZE DB
    107107
    108     if [ "x$create_db" == "xyes" ]; then
    109         if [ "x$rootpass" == "x" ]; then
     108    if [ "x$create_db" = "xyes" ]; then
     109        if [ "x$rootpass" = "x" ]; then
    110110            mysqlroot="mysql -uroot"
    111111            mysqluser="mysql -u$user -p$pass"
     
    114114            mysqluser="mysql -u$user -p$pass"
    115115        fi
    116         if [ "x$create_user" == "xyes" ]; then
     116        if [ "x$create_user" = "xyes" ]; then
    117117            echo "create user '$user'@'%' identified by '$pass';" | $mysqlroot
    118118            echo "grant all privileges on analytics.* to '$user'@'%';" | $mysqlroot
     
    157157# CONFIG APACHE
    158158
    159     a2enmod rewrite
    160     a2ensite analytics
    161     service apache2 restart
     159    if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
     160        . /usr/share/apache2/apache2-maintscript-helper
     161        apache2_invoke enmod rewrite || exit $?
     162        apache2_invoke ensite analytics || exit $?
     163    fi
    162164
    163165    if [ "${print_info}" = "yes" ]; then
  • lliurex-analytics-server/trunk/fuentes/debian/prerm

    r3366 r3605  
    1 #!/bin/bash
     1#!/bin/sh
    22# prerm script
    33#
    44# see: dh_installdeb(1)
    55
    6 #set -e
     6set -e
    77
    88# summary of how this script can be called:
     
    2020case "$1" in
    2121    remove|upgrade|deconfigure)
    22         a2dissite analytics
     22        if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
     23            . /usr/share/apache2/apache2-maintscript-helper
     24            apache2_invoke dissite analytics || exit $?
     25        fi
    2326    ;;
    2427
Note: See TracChangeset for help on using the changeset viewer.