From 8e1fb4145b25b3bbb01a6277459c4b0926fda56e Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Thu, 3 Apr 2014 10:51:04 +0200 Subject: [PATCH] typos and comment and removing of french in alternc.config --- debian/alternc-awstats.cron.d | 2 +- debian/alternc.config | 40 +++++++++++++++-------------------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/debian/alternc-awstats.cron.d b/debian/alternc-awstats.cron.d index 0149d9d0..96cc5555 100644 --- a/debian/alternc-awstats.cron.d +++ b/debian/alternc-awstats.cron.d @@ -1 +1 @@ -30 4 * * * root /usr/lib/alternc/alternc-awstats +30 4 * * * root /usr/lib/alternc/alternc-awstats diff --git a/debian/alternc.config b/debian/alternc.config index 2784ed09..35ea3f4f 100644 --- a/debian/alternc.config +++ b/debian/alternc.config @@ -1,14 +1,11 @@ -#!/bin/bash - -set -e +#!/bin/bash -e # Source debconf library. . /usr/share/debconf/confmodule db_capb backup - -#Return if everything is good, exit error number otherwise +# Validate an IPv4 address. function valid_ip() { local ip=$1 @@ -27,7 +24,7 @@ function valid_ip() } -#checking mysql connectivity and updating local.sh variables accordingly +# Checking mysql connectivity and updating local.sh environment variables accordingly check_mysql() { STATE=0 @@ -68,12 +65,9 @@ check_mysql() done } +# Return the deepest existing directory in a path function get_first_existing_dir() { - # Prend en premier parametre un chemin - # Retourne le répertoire parent existant le plus "proche" - # Exemple: on lui donne /var/www/alternc/gerard/dupont/ mais - # seul /var/www/alternc existe, ca répond /var/www/alternc dir="$1" if [ -z "$dir" ] ; then return 0 @@ -86,7 +80,7 @@ function get_first_existing_dir() } -# default values for local.sh +# Compute default values for local.sh MYSQL_HOST=127.0.0.1 MYSQL_DATABASE=alternc MYSQL_USER=sysusr @@ -114,6 +108,8 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do if [ -r /etc/alternc/local.sh ]; then # source the current config . /etc/alternc/local.sh + # and push it into debconf (its values have priority over anything + fi # upgrade <= 3.0 to >= 3.1 if [ "x$ALTERNC_LOC" != "x" ]; then @@ -121,7 +117,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do ALTERNC_MAIL="$ALTERNC_LOC/mail" fi - #We ask for the hosting name and the FQDN + # We ask for the hosting name and the FQDN db_get alternc/hostingname if [ -z "$RET" ]; then db_set alternc/hostingname "$HOSTING" @@ -135,13 +131,12 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do db_set alternc/desktopname "$FQDN" db_input high alternc/desktopname || true fi - # Be sure that the FQDN is lowercase (Bug #1405) + # Ensure that the FQDN is lowercase (Fixes #1405) db_get alternc/desktopname db_set alternc/desktopname "`echo $RET | tr '[:upper:]' '[:lower:]'`" - # End bug #1405 ;; 3) - #we ask for the public and private ip + # Ask for the public and private ip db_get alternc/public_ip if [ -z "$RET" ]; then db_set alternc/public_ip "$PUBLIC_IP" @@ -172,7 +167,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do done ;; 4) - #private IP + # Private IP db_get alternc/internal_ip if [ -z "$RET" ]; then db_set alternc/internal_ip "$INTERNAL_IP" @@ -190,7 +185,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do done ;; 5) - #We ask for the DNS server for the ip + # Ask for the DNS servers db_get alternc/ns1 if [ -z "$RET" ]; then db_set alternc/ns1 "$NS1_HOSTNAME" @@ -225,7 +220,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do 10) db_get alternc/use_remote_mysql if [ "$RET" == "true" ]; then - # user want to use a remote server + # User want to use a remote server check_mysql fi ;; @@ -240,10 +235,10 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do db_get alternc/alternc_html ALTERNC_HTML="$RET" - #checking acl and quota activation. + # Checking acl and quota activation. basedir=`get_first_existing_dir "$ALTERNC_HTML"`; MOUNT_POINT=$(df -P ${basedir} | tail -n 1 | awk '{print $6}') - #we get the first existing dir + # Get the first existing dir aclcheckfile="$basedir/test-acl" touch "$aclcheckfile" setfacl -m u:root:rwx "$aclcheckfile" 2>/dev/null || ( @@ -259,7 +254,6 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 14 ]; do if [ -z "$RET" ]; then db_input critical alternc/quotauninstalled || true db_go - #db_reset alternc/quotauninstalled || true db_set alternc/quotauninstalled "false" || true fi ) @@ -323,8 +317,8 @@ if [ -z "$RET" ]; then db_set alternc/mysql/host "$MYSQL_HOST" fi -#Even if we asked the question concerning the database earlier in the process -#those calls are needed to pass the variable of remote sql server to AlternC +# Even if we asked the question concerning the database earlier in the process +# Those calls are needed to pass the variable of remote sql server to AlternC db_get alternc/mysql/db if [ -z "$RET" ]; then db_set alternc/mysql/db "$MYSQL_DATABASE"