Your IP : 3.15.208.206


Current Path : /var/lib/dpkg/info/
Upload File :
Current File : /var/lib/dpkg/info/roundcube-core.config

#!/bin/sh

set -e

. /usr/share/debconf/confmodule

db_input medium roundcube/hosts || true
db_go || true

if [ "$1" = "configure" -a "$DPKG_MAINTSCRIPT_NAME" = "postinst" ] || \
        [ "$1" = "reconfigure" ]; then
    # retrieve all available languages
    instd_langs=""
    for l in /usr/share/roundcube/program/localization/*/messages.inc; do
        l="${l%/messages.inc}"
        instd_langs="${instd_langs:+"$instd_langs, "}${l##*/}"
    done
    db_subst roundcube/language languages "$instd_langs"
    # first try to get the current choice in case of preseeding or if the
    # question has already been asked
    db_get roundcube/language || true
    locale="$RET"
    if [ -n "$locale" ] && [ -d "/usr/share/roundcube/program/localization/$locale" ]; then
        # we get our answer (db_set should be useless in fact)
        db_set roundcube/language "$locale"
    else
        # either we never answered the question or the locale does not
        # exist any more. In both cases, we do as if we never seen the
        # question.
        db_fset roundcube/language seen false
        # try to guess the locale
        locale="${LANG%%[@.]*}"
        if [ -d "/usr/share/roundcube/program/localization/$locale" ]; then
            db_set roundcube/language "$locale"
        else
            locale="${locale%%_*}"
            if [ -d "/usr/share/roundcube/program/localization/$locale" ]; then
                db_set roundcube/language "$locale"
            else
                db_set roundcube/language en_US
            fi
        fi
    fi
    # ask the question
    db_input medium roundcube/language || true
    db_go || true
fi


# if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
#     dbc_dbtypes="mysql, pgsql, sqlite3"
#     dbc_authmethod_user="password"
#     . /usr/share/dbconfig-common/dpkg/config
#     dbc_go roundcube "$@"
# fi

db_input medium roundcube/reconfigure-webserver || true
db_go || true
db_input medium roundcube/restart-webserver || true
db_go || true