[enh] homogenize coding style

- use 2 spaces for indentations
- remove tabulations
- remove trailing spaces
- if/then statements
This commit is contained in:
Pierre-Louis Bonicoli 2014-03-25 18:34:34 +01:00
parent 6dd6094b71
commit a5f544b705
1 changed files with 117 additions and 132 deletions

73
debian/alternc.config vendored
View File

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
set -e
@ -28,8 +28,8 @@ function valid_ip()
#checking mysql connectivity and updating local.sh variables accordingly
check_mysql(){
check_mysql()
{
STATE=0
while [ "$STATE" -eq 0 ]; do
db_input high alternc/mysql/host || true
@ -59,10 +59,10 @@ check_mysql(){
fi
fi
done
}
function get_first_existing_dir() {
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
@ -79,7 +79,6 @@ function get_first_existing_dir() {
}
# default values for local.sh
MYSQL_HOST=127.0.0.1
MYSQL_DATABASE=alternc
@ -110,8 +109,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do
. /etc/alternc/local.sh
fi
# upgrade <= 3.0 to >= 3.1
if [ "x$ALTERNC_LOC" != "x" ]
then
if [ "x$ALTERNC_LOC" != "x" ]; then
ALTERNC_HTML="$ALTERNC_LOC/html"
ALTERNC_MAIL="$ALTERNC_LOC/mail"
fi
@ -205,7 +203,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do
# We need to set the alternc_location here because we have to test for quotas and acls
db_get alternc/alternc_html
if [ -z "$RET" ];then
if [ -z "$RET" ]; then
db_set alternc/alternc_html $ALTERNC_HTML
db_input high alternc/alternc_html
fi
@ -240,7 +238,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do
;;
11)
db_get alternc/alternc_mail
if [ -z "$RET" ];then
if [ -z "$RET" ]; then
db_set alternc/alternc_mail $ALTERNC_MAIL
db_input high alternc/alternc_mail
fi
@ -297,9 +295,8 @@ fi
db_get alternc/monitor_ip
if [ -z "$RET" ]
then
db_set alternc/monitor_ip "$MONITOR_IP"
if [ -z "$RET" ]; then
db_set alternc/monitor_ip "$MONITOR_IP"
fi
db_get alternc/ns2
@ -309,31 +306,26 @@ db_set alternc/ns2 "$NS2_HOSTNAME"
fi
db_get alternc/default_mx2
if [ -z "$RET" ]
then
db_set alternc/default_mx2 "$DEFAULT_SECONDARY_MX"
if [ -z "$RET" ]; then
db_set alternc/default_mx2 "$DEFAULT_SECONDARY_MX"
fi
db_get alternc/mysql/host
if [ -z "$RET" ]
then
db_set alternc/mysql/host "$MYSQL_HOST"
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
db_get alternc/mysql/db
if [ -z "$RET" ]
then
db_set alternc/mysql/db "$MYSQL_DATABASE"
if [ -z "$RET" ]; then
db_set alternc/mysql/db "$MYSQL_DATABASE"
fi
db_get alternc/mysql/user
if [ -z "$RET" ]
then
if [ -z "$RET" ]; then
db_get alternc/mysql/remote_user
if [ -z "$RET" ]
then
if [ -z "$RET" ]; then
db_set alternc/mysql/user "$MYSQL_USER"
else
db_set alternc/mysql/user "$RET"
@ -341,11 +333,9 @@ if [ -z "$RET" ]
fi
db_get alternc/mysql/password
if [ -z "$RET" ]
then
if [ -z "$RET" ]; then
db_get alternc/mysql/remote_password
if [ -z "$RET" ]
then
if [ -z "$RET" ]; then
db_set alternc/mysql/password "$MYSQL_PASS"
else
db_set alternc/mysql/password "$RET"
@ -353,33 +343,28 @@ if [ -z "$RET" ]
fi
db_get alternc/mysql/client
if [ -z "$RET" ]
then
if [ -z "$RET" ]; then
db_set alternc/mysql/client "$MYSQL_CLIENT"
fi
db_get alternc/sql/backup_type
if [ -z "$RET" ]
then
db_set alternc/sql/backup_type "$SQLBACKUP_TYPE"
if [ -z "$RET" ]; then
db_set alternc/sql/backup_type "$SQLBACKUP_TYPE"
fi
db_get alternc/sql/backup_overwrite
if [ -z "$RET" ]
then
db_set alternc/sql/backup_overwrite "$SQLBACKUP_OVERWRITE"
if [ -z "$RET" ]; then
db_set alternc/sql/backup_overwrite "$SQLBACKUP_OVERWRITE"
fi
db_get alternc/mysql/alternc_mail_user
if [ -z "$RET" ]
then
db_set alternc/mysql/alternc_mail_user "$MYSQL_MAIL_USER"
if [ -z "$RET" ]; then
db_set alternc/mysql/alternc_mail_user "$MYSQL_MAIL_USER"
fi
db_get alternc/mysql/alternc_mail_password
if [ -z "$RET" ]
then
db_set alternc/mysql/alternc_mail_password "$MYSQL_MAIL_PASS"
if [ -z "$RET" ]; then
db_set alternc/mysql/alternc_mail_password "$MYSQL_MAIL_PASS"
fi
db_input low alternc/default_mx2 || true