[enh] homogenize coding style
- use 2 spaces for indentations - remove tabulations - remove trailing spaces - if/then statements
This commit is contained in:
		
							parent
							
								
									6dd6094b71
								
							
						
					
					
						commit
						a5f544b705
					
				|  | @ -1,4 +1,4 @@ | ||||||
| #! /bin/bash | #!/bin/bash | ||||||
| 
 | 
 | ||||||
| set -e | set -e | ||||||
| 
 | 
 | ||||||
|  | @ -28,8 +28,8 @@ function valid_ip() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| #checking mysql connectivity and updating local.sh variables accordingly | #checking mysql connectivity and updating local.sh variables accordingly | ||||||
| check_mysql(){ | check_mysql() | ||||||
| 
 | { | ||||||
|   STATE=0 |   STATE=0 | ||||||
|   while [ "$STATE" -eq 0 ]; do |   while [ "$STATE" -eq 0 ]; do | ||||||
|     db_input high alternc/mysql/host || true |     db_input high alternc/mysql/host || true | ||||||
|  | @ -59,10 +59,10 @@ check_mysql(){ | ||||||
|       fi |       fi | ||||||
|     fi |     fi | ||||||
|   done |   done | ||||||
| 
 |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function get_first_existing_dir() { | function get_first_existing_dir() | ||||||
|  | { | ||||||
|   # Prend en premier parametre un chemin |   # Prend en premier parametre un chemin | ||||||
|   # Retourne le répertoire parent existant le plus "proche" |   # Retourne le répertoire parent existant le plus "proche" | ||||||
|   # Exemple: on lui donne /var/www/alternc/gerard/dupont/ mais |   # Exemple: on lui donne /var/www/alternc/gerard/dupont/ mais | ||||||
|  | @ -79,7 +79,6 @@ function get_first_existing_dir() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| # default values for local.sh | # default values for local.sh | ||||||
| MYSQL_HOST=127.0.0.1 | MYSQL_HOST=127.0.0.1 | ||||||
| MYSQL_DATABASE=alternc | MYSQL_DATABASE=alternc | ||||||
|  | @ -110,8 +109,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do | ||||||
|       . /etc/alternc/local.sh |       . /etc/alternc/local.sh | ||||||
|     fi |     fi | ||||||
|     # upgrade <= 3.0 to >= 3.1 |     # upgrade <= 3.0 to >= 3.1 | ||||||
|     if [ "x$ALTERNC_LOC" != "x" ] |     if [ "x$ALTERNC_LOC" != "x" ]; then | ||||||
|     then |  | ||||||
|       ALTERNC_HTML="$ALTERNC_LOC/html" |       ALTERNC_HTML="$ALTERNC_LOC/html" | ||||||
|       ALTERNC_MAIL="$ALTERNC_LOC/mail" |       ALTERNC_MAIL="$ALTERNC_LOC/mail" | ||||||
|     fi |     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 |     # We need to set the alternc_location here because we have to test for quotas and acls | ||||||
| 
 | 
 | ||||||
|     db_get alternc/alternc_html |     db_get alternc/alternc_html | ||||||
|     if [ -z "$RET" ];then |     if [ -z "$RET" ]; then | ||||||
|       db_set alternc/alternc_html $ALTERNC_HTML |       db_set alternc/alternc_html $ALTERNC_HTML | ||||||
|       db_input high alternc/alternc_html |       db_input high alternc/alternc_html | ||||||
|     fi |     fi | ||||||
|  | @ -240,7 +238,7 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do | ||||||
|   ;; |   ;; | ||||||
|   11) |   11) | ||||||
|     db_get alternc/alternc_mail |     db_get alternc/alternc_mail | ||||||
|     if [ -z "$RET" ];then |     if [ -z "$RET" ]; then | ||||||
|       db_set alternc/alternc_mail $ALTERNC_MAIL |       db_set alternc/alternc_mail $ALTERNC_MAIL | ||||||
|       db_input high alternc/alternc_mail |       db_input high alternc/alternc_mail | ||||||
|     fi |     fi | ||||||
|  | @ -297,9 +295,8 @@ fi | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| db_get alternc/monitor_ip | db_get alternc/monitor_ip | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |   db_set alternc/monitor_ip "$MONITOR_IP" | ||||||
| db_set alternc/monitor_ip "$MONITOR_IP" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/ns2 | db_get alternc/ns2 | ||||||
|  | @ -309,31 +306,26 @@ db_set alternc/ns2 "$NS2_HOSTNAME" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/default_mx2 | db_get alternc/default_mx2 | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |   db_set alternc/default_mx2 "$DEFAULT_SECONDARY_MX" | ||||||
| db_set alternc/default_mx2 "$DEFAULT_SECONDARY_MX" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/mysql/host | db_get alternc/mysql/host | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |   db_set alternc/mysql/host "$MYSQL_HOST" | ||||||
| db_set alternc/mysql/host "$MYSQL_HOST" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| #Even if we asked the question concerning the database earlier in the process | #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 | #those calls are needed to pass the variable of remote sql server to AlternC | ||||||
| db_get alternc/mysql/db | db_get alternc/mysql/db | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |   db_set alternc/mysql/db "$MYSQL_DATABASE" | ||||||
| db_set alternc/mysql/db "$MYSQL_DATABASE" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/mysql/user | db_get alternc/mysql/user | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |  | ||||||
|   db_get alternc/mysql/remote_user |   db_get alternc/mysql/remote_user | ||||||
|   if [ -z "$RET" ] |   if [ -z "$RET" ]; then | ||||||
|   then |  | ||||||
|     db_set alternc/mysql/user "$MYSQL_USER" |     db_set alternc/mysql/user "$MYSQL_USER" | ||||||
|   else |   else | ||||||
|     db_set alternc/mysql/user "$RET" |     db_set alternc/mysql/user "$RET" | ||||||
|  | @ -341,11 +333,9 @@ if [ -z "$RET" ] | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/mysql/password | db_get alternc/mysql/password | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |  | ||||||
|   db_get alternc/mysql/remote_password |   db_get alternc/mysql/remote_password | ||||||
|   if [ -z "$RET" ] |   if [ -z "$RET" ]; then | ||||||
|     then |  | ||||||
|     db_set alternc/mysql/password "$MYSQL_PASS" |     db_set alternc/mysql/password "$MYSQL_PASS" | ||||||
|   else |   else | ||||||
|     db_set alternc/mysql/password "$RET" |     db_set alternc/mysql/password "$RET" | ||||||
|  | @ -353,33 +343,28 @@ if [ -z "$RET" ] | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/mysql/client | db_get alternc/mysql/client | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |  | ||||||
|   db_set alternc/mysql/client "$MYSQL_CLIENT" |   db_set alternc/mysql/client "$MYSQL_CLIENT" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/sql/backup_type | db_get alternc/sql/backup_type | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |   db_set alternc/sql/backup_type "$SQLBACKUP_TYPE" | ||||||
| db_set alternc/sql/backup_type "$SQLBACKUP_TYPE" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/sql/backup_overwrite | db_get alternc/sql/backup_overwrite | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |   db_set alternc/sql/backup_overwrite "$SQLBACKUP_OVERWRITE" | ||||||
| db_set alternc/sql/backup_overwrite "$SQLBACKUP_OVERWRITE" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/mysql/alternc_mail_user | db_get alternc/mysql/alternc_mail_user | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |   db_set alternc/mysql/alternc_mail_user "$MYSQL_MAIL_USER" | ||||||
| db_set alternc/mysql/alternc_mail_user "$MYSQL_MAIL_USER" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_get alternc/mysql/alternc_mail_password | db_get alternc/mysql/alternc_mail_password | ||||||
| if [ -z "$RET" ] | if [ -z "$RET" ]; then | ||||||
|     then |   db_set alternc/mysql/alternc_mail_password "$MYSQL_MAIL_PASS" | ||||||
| db_set alternc/mysql/alternc_mail_password "$MYSQL_MAIL_PASS" |  | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| db_input low alternc/default_mx2 || true | db_input low alternc/default_mx2 || true | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Pierre-Louis Bonicoli
						Pierre-Louis Bonicoli