Browse Source

Create webmail database before restoring from backup

Bob Mottram 8 years ago
parent
commit
cb7374a8c5
2 changed files with 190 additions and 187 deletions
  1. 190
    171
      src/freedombone-app-webmail
  2. 0
    16
      src/freedombone-utils-database

+ 190
- 171
src/freedombone-app-webmail View File

@@ -38,203 +38,222 @@ WEBMAIL_ADMIN_PASSWORD=
38 38
 WEB_PATH=/var/www
39 39
 WEBMAIL_PATH=$WEB_PATH/webmail
40 40
 
41
+function get_mariadb_webmail_admin_password {
42
+	if [ -f /home/$MY_USERNAME/README ]; then
43
+		if grep -q "MariaDB webmail admin password" /home/$MY_USERNAME/README; then
44
+			WEBMAIL_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB webmail admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')
45
+		fi
46
+	fi
47
+}
48
+
49
+function webmail_create_database {
50
+	function_check get_mariadb_webmail_admin_password
51
+	get_mariadb_webmail_admin_password
52
+	if [ ! $WEBMAIL_ADMIN_PASSWORD ]; then
53
+		if [ -f $IMAGE_PASSWORD_FILE ]; then
54
+			WEBMAIL_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
55
+		else
56
+			WEBMAIL_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
57
+		fi
58
+	fi
59
+	if [ ! $WEBMAIL_ADMIN_PASSWORD ]; then
60
+		return
61
+	fi
62
+	function_check create_database
63
+	create_database webmail "$WEBMAIL_ADMIN_PASSWORD"
64
+}
65
+
41 66
 function reconfigure_webmail {
42
-    echo -n ''
67
+	echo -n ''
43 68
 }
44 69
 
45 70
 function upgrade_webmail {
46
-    if ! grep -Fxq "install_webmail" $COMPLETION_FILE; then
47
-	return
48
-    fi
49
-    function_check set_repo_commit
50
-    set_repo_commit $WEBMAIL_PATH "Webmail commit" "$WEBMAIL_COMMIT" $WEBMAIL_REPO
71
+	if ! grep -Fxq "install_webmail" $COMPLETION_FILE; then
72
+		return
73
+	fi
74
+	function_check set_repo_commit
75
+	set_repo_commit $WEBMAIL_PATH "Webmail commit" "$WEBMAIL_COMMIT" $WEBMAIL_REPO
51 76
 }
52 77
 
53 78
 function backup_local_webmail {
54
-    if ! grep -q "install_webmail" $COMPLETION_FILE; then
55
-	return
56
-    fi
57
-    echo $"Backing up webmail"
79
+	if ! grep -q "install_webmail" $COMPLETION_FILE; then
80
+		return
81
+	fi
82
+	echo $"Backing up webmail"
58 83
 
59
-    function_check backup_database_to_usb
60
-    backup_database_to_usb webmail
84
+	function_check backup_database_to_usb
85
+	backup_database_to_usb webmail
61 86
 
62
-    echo $"Backing up webmail complete"
87
+	echo $"Backing up webmail complete"
63 88
 }
64 89
 
65 90
 function restore_local_webmail {
66
-    if ! grep -q "install_webmail" $COMPLETION_FILE; then
67
-	return
68
-    fi
69
-    echo $"Restoring webmail"
91
+	if ! grep -q "install_webmail" $COMPLETION_FILE; then
92
+		return
93
+	fi
94
+	echo $"Restoring webmail"
95
+
96
+	function_check webmail_create_database
97
+	webmail_create_database
70 98
 
71
-    function_check restore_database
72
-    restore_database webmail
99
+	function_check restore_database
100
+	restore_database webmail
73 101
 
74
-    echo $"Restore of webmail complete"
102
+	echo $"Restore of webmail complete"
75 103
 }
76 104
 
77 105
 function backup_remote_webmail {
78
-    echo -n ''
106
+	echo -n ''
79 107
 }
80 108
 
81 109
 function restore_remote_webmail {
82
-    echo -n ''
110
+	echo -n ''
83 111
 }
84 112
 
85 113
 function remove_webmail {
86
-    if ! grep -Fxq "install_webmail" $COMPLETION_FILE; then
87
-	return
88
-    fi
89
-    nginx_dissite webmail
90
-    if [ -f /etc/nginx/sites-available/webmail ]; then
91
-	rm /etc/nginx/sites-available/webmail
92
-    fi
93
-    function_check remove_onion_service
94
-    remove_onion_service webmail ${WEBMAIL_ONION_PORT}
95
-    function_check drop_database
96
-    drop_database webmail
97
-    if [ -d $WEB_PATH/webmail ]; then
98
-	rm -rf $WEB_PATH/webmail
99
-    fi
100
-    sed -i '/Webmail /d' $COMPLETION_FILE
101
-    sed -i '/install_webmail/d' $COMPLETION_FILE
114
+	if ! grep -Fxq "install_webmail" $COMPLETION_FILE; then
115
+		return
116
+	fi
117
+	nginx_dissite webmail
118
+	if [ -f /etc/nginx/sites-available/webmail ]; then
119
+		rm /etc/nginx/sites-available/webmail
120
+	fi
121
+	function_check remove_onion_service
122
+	remove_onion_service webmail ${WEBMAIL_ONION_PORT}
123
+	function_check drop_database
124
+	drop_database webmail
125
+	if [ -d $WEB_PATH/webmail ]; then
126
+		rm -rf $WEB_PATH/webmail
127
+	fi
128
+	sed -i '/Webmail /d' $COMPLETION_FILE
129
+	sed -i '/install_webmail/d' $COMPLETION_FILE
102 130
 }
103 131
 
104 132
 function install_webmail {
105
-    if grep -Fxq "install_webmail" $COMPLETION_FILE; then
106
-	return
107
-    fi
108
-    if [ -d /etc/apache2 ]; then
109
-	rm -rf /etc/apache2
110
-	echo $'Removed Apache installation after Dokuwiki install'
111
-    fi
112
-
113
-    function_check install_mariadb
114
-    install_mariadb
115
-
116
-    function_check get_mariadb_password
117
-    get_mariadb_password
118
-
119
-    function_check repair_databases_script
120
-    repair_databases_script
121
-
122
-    apt-get -y install php5-common php5-cli php5-curl php5-gd php5-mysql php5-mcrypt git
123
-    apt-get -y install php5-dev imagemagick php5-imagick php5-sqlite php-auth-sasl php-net-smtp php-mime-type
124
-    apt-get -y install php-mail-mime php-mail-mimedecode php-net-ldap3 php5-pspell
125
-    pear install Net_IDNA2
126
-
127
-    if [ ! -f $WEBMAIL_PATH/index.php ]; then
128
-	cd $WEB_PATH
129
-	git_clone $WEBMAIL_REPO webmail
130
-	cd $WEBMAIL_PATH
131
-	git checkout $WEBMAIL_COMMIT -b $WEBMAIL_COMMIT
132
-	if ! grep -q "Webmail commit" $COMPLETION_FILE; then
133
-	    echo "Webmail commit:$WEBMAIL_COMMIT" >> $COMPLETION_FILE
134
-	else
135
-	    sed -i "s/Webmail commit.*/Webmail commit:$WEBMAIL_COMMIT/g" $COMPLETION_FILE
136
-	fi
137
-    fi
138
-    if [ ! -f $WEBMAIL_PATH/index.php ]; then
139
-	echo $'Did not clone webmail repo'
140
-	exit 52825
141
-    fi
142
-
143
-    WEBMAIL_ONION_HOSTNAME=$(add_onion_service webmail 80 ${WEBMAIL_ONION_PORT})
144
-    echo "Webmail onion domain:${WEBMAIL_ONION_HOSTNAME}" >> $COMPLETION_FILE
145
-
146
-    function_check get_mariadb_webmail_admin_password
147
-    get_mariadb_webmail_admin_password
148
-    if [ ! $WEBMAIL_ADMIN_PASSWORD ]; then
149
-	if [ -f $IMAGE_PASSWORD_FILE ]; then
150
-	    WEBMAIL_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
151
-	else
152
-	    WEBMAIL_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
153
-	fi
154
-    fi
155
-    function_check create_database
156
-    create_database webmail "$WEBMAIL_ADMIN_PASSWORD"
157
-    mysql -u root --password="$MARIADB_PASSWORD" -D webmail < $WEBMAIL_PATH/SQL/mysql.initial.sql
158
-
159
-    if [ ! -d /var/www/$DEFAULT_DOMAIN_NAME/htdocs ]; then
160
-	mkdir -p /var/www/$DEFAULT_DOMAIN_NAME/htdocs
161
-    fi
162
-    ln -s $WEBMAIL_PATH /var/www/$DEFAULT_DOMAIN_NAME/htdocs/webmail
163
-
164
-    if [ ! -f /var/www/webmail/config/config.inc.php ]; then
165
-	# generate the configuration
166
-	echo '<?php' > /var/www/webmail/config/config.inc.php
167
-	echo "\$config['db_dsnw'] = 'mysql://root:${MARIADB_PASSWORD}@localhost/webmail';" >> /var/www/webmail/config/config.inc.php
168
-	echo "\$config['default_host'] = 'localhost';" >> /var/www/webmail/config/config.inc.php
169
-	echo "\$config['support_url'] = '';" >> /var/www/webmail/config/config.inc.php
170
-	WEBMAIL_DES_KEY="$(create_password 25)"
171
-	echo "\$config['des_key'] = '${WEBMAIL_DES_KEY}';" >> /var/www/webmail/config/config.inc.php
172
-	echo "\$config['product_name'] = '${PROJECT_NAME}';" >> /var/www/webmail/config/config.inc.php
173
-	echo "\$config['plugins'] = array('enigma');" >> /var/www/webmail/config/config.inc.php
174
-	echo "\$config['mime_param_folding'] = 0;" >> /var/www/webmail/config/config.inc.php
175
-	echo "\$config['enable_installer'] = false;" >> /var/www/webmail/config/config.inc.php
176
-    fi
177
-
178
-    chown -R www-data:www-data $WEBMAIL_PATH
179
-
180
-    echo 'server {' > /etc/nginx/sites-available/webmail
181
-    echo "  listen 127.0.0.1:$WEBMAIL_ONION_PORT default_server;" >> /etc/nginx/sites-available/webmail
182
-    echo "  server_name $WEBMAIL_ONION_HOSTNAME;" >> /etc/nginx/sites-available/webmail
183
-    echo "  root ${WEBMAIL_PATH};" >> /etc/nginx/sites-available/webmail
184
-    echo '  index index.php index.html index.htm;' >> /etc/nginx/sites-available/webmail
185
-    echo '  access_log off;' >> /etc/nginx/sites-available/webmail
186
-    echo '  error_log off;' >> /etc/nginx/sites-available/webmail
187
-    echo '  location / {' >> /etc/nginx/sites-available/webmail
188
-    echo '    try_files $uri $uri/ /index.php?q=$uri&$args;' >> /etc/nginx/sites-available/webmail
189
-    echo '  }' >> /etc/nginx/sites-available/webmail
190
-    echo '  error_page 404 /404.html;' >> /etc/nginx/sites-available/webmail
191
-    echo '  error_page 500 502 503 504 /50x.html;' >> /etc/nginx/sites-available/webmail
192
-    echo '  location = /50x.html {' >> /etc/nginx/sites-available/webmail
193
-    echo "    root ${WEBMAIL_PATH};" >> /etc/nginx/sites-available/webmail
194
-    echo '  }' >> /etc/nginx/sites-available/webmail
195
-    echo '  location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {' >> /etc/nginx/sites-available/webmail
196
-    echo '    deny all;' >> /etc/nginx/sites-available/webmail
197
-    echo '  }' >> /etc/nginx/sites-available/webmail
198
-    echo '  location ~ ^/(config|temp|logs)/ {' >> /etc/nginx/sites-available/webmail
199
-    echo '    deny all;' >> /etc/nginx/sites-available/webmail
200
-    echo '  }' >> /etc/nginx/sites-available/webmail
201
-    echo '  location ~ /\. {' >> /etc/nginx/sites-available/webmail
202
-    echo '    deny all;' >> /etc/nginx/sites-available/webmail
203
-    echo '    access_log off;' >> /etc/nginx/sites-available/webmail
204
-    echo '    log_not_found off;' >> /etc/nginx/sites-available/webmail
205
-    echo '  }' >> /etc/nginx/sites-available/webmail
206
-    echo '  location ~ \.php$ {' >> /etc/nginx/sites-available/webmail
207
-    echo '    try_files $uri =404;' >> /etc/nginx/sites-available/webmail
208
-    echo '    fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/webmail
209
-    echo '    fastcgi_index index.php;' >> /etc/nginx/sites-available/webmail
210
-    echo '    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> /etc/nginx/sites-available/webmail
211
-    echo '    include fastcgi_params;' >> /etc/nginx/sites-available/webmail
212
-    echo '  }' >> /etc/nginx/sites-available/webmail
213
-    echo '  add_header X-Frame-Options DENY;' >> /etc/nginx/sites-available/webmail
214
-    echo '  add_header X-Content-Type-Options nosniff;' >> /etc/nginx/sites-available/webmail
215
-    echo '  client_max_body_size 15m;' >> /etc/nginx/sites-available/webmail
216
-    echo '}' >> /etc/nginx/sites-available/webmail
217
-
218
-    nginx_ensite webmail
219
-    systemctl restart php5-fpm
220
-    systemctl restart nginx
221
-
222
-    if ! grep -q "Webmail" /home/$MY_USERNAME/README; then
223
-	echo '' >> /home/$MY_USERNAME/README
224
-	echo '' >> /home/$MY_USERNAME/README
225
-	echo 'Webmail' >> /home/$MY_USERNAME/README
226
-	echo '=======' >> /home/$MY_USERNAME/README
227
-	if [[ $ONION_ONLY == 'no' ]]; then
228
-	    echo $"Open https://$DEFAULT_DOMAIN_NAME/webmail/index.php" >> /home/$MY_USERNAME/README
229
-	else
230
-	    echo $"Open http://$WEBMAIL_ONION_HOSTNAME" >> /home/$MY_USERNAME/README
231
-	fi
232
-	echo $"MariaDB webmail admin password: $WEBMAIL_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
233
-	chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
234
-	chmod 600 /home/$MY_USERNAME/README
235
-    fi
236
-
237
-    echo 'install_webmail' >> $COMPLETION_FILE
133
+	if grep -Fxq "install_webmail" $COMPLETION_FILE; then
134
+		return
135
+	fi
136
+	if [ -d /etc/apache2 ]; then
137
+		rm -rf /etc/apache2
138
+		echo $'Removed Apache installation after Dokuwiki install'
139
+	fi
140
+
141
+	function_check install_mariadb
142
+	install_mariadb
143
+
144
+	function_check get_mariadb_password
145
+	get_mariadb_password
146
+
147
+	function_check repair_databases_script
148
+	repair_databases_script
149
+
150
+	apt-get -y install php5-common php5-cli php5-curl php5-gd php5-mysql php5-mcrypt git
151
+	apt-get -y install php5-dev imagemagick php5-imagick php5-sqlite php-auth-sasl php-net-smtp php-mime-type
152
+	apt-get -y install php-mail-mime php-mail-mimedecode php-net-ldap3 php5-pspell
153
+	pear install Net_IDNA2
154
+
155
+	if [ ! -f $WEBMAIL_PATH/index.php ]; then
156
+		cd $WEB_PATH
157
+		git_clone $WEBMAIL_REPO webmail
158
+		cd $WEBMAIL_PATH
159
+		git checkout $WEBMAIL_COMMIT -b $WEBMAIL_COMMIT
160
+		if ! grep -q "Webmail commit" $COMPLETION_FILE; then
161
+			echo "Webmail commit:$WEBMAIL_COMMIT" >> $COMPLETION_FILE
162
+		else
163
+			sed -i "s/Webmail commit.*/Webmail commit:$WEBMAIL_COMMIT/g" $COMPLETION_FILE
164
+		fi
165
+	fi
166
+	if [ ! -f $WEBMAIL_PATH/index.php ]; then
167
+		echo $'Did not clone webmail repo'
168
+		exit 52825
169
+	fi
170
+
171
+	WEBMAIL_ONION_HOSTNAME=$(add_onion_service webmail 80 ${WEBMAIL_ONION_PORT})
172
+	echo "Webmail onion domain:${WEBMAIL_ONION_HOSTNAME}" >> $COMPLETION_FILE
173
+
174
+	webmail_create_database
175
+
176
+	mysql -u root --password="$MARIADB_PASSWORD" -D webmail < $WEBMAIL_PATH/SQL/mysql.initial.sql
177
+
178
+	if [ ! -d /var/www/$DEFAULT_DOMAIN_NAME/htdocs ]; then
179
+		mkdir -p /var/www/$DEFAULT_DOMAIN_NAME/htdocs
180
+	fi
181
+	ln -s $WEBMAIL_PATH /var/www/$DEFAULT_DOMAIN_NAME/htdocs/webmail
182
+
183
+	if [ ! -f /var/www/webmail/config/config.inc.php ]; then
184
+		# generate the configuration
185
+		echo '<?php' > /var/www/webmail/config/config.inc.php
186
+		echo "\$config['db_dsnw'] = 'mysql://root:${MARIADB_PASSWORD}@localhost/webmail';" >> /var/www/webmail/config/config.inc.php
187
+		echo "\$config['default_host'] = 'localhost';" >> /var/www/webmail/config/config.inc.php
188
+		echo "\$config['support_url'] = '';" >> /var/www/webmail/config/config.inc.php
189
+		WEBMAIL_DES_KEY="$(create_password 25)"
190
+		echo "\$config['des_key'] = '${WEBMAIL_DES_KEY}';" >> /var/www/webmail/config/config.inc.php
191
+		echo "\$config['product_name'] = '${PROJECT_NAME}';" >> /var/www/webmail/config/config.inc.php
192
+		echo "\$config['plugins'] = array('enigma');" >> /var/www/webmail/config/config.inc.php
193
+		echo "\$config['mime_param_folding'] = 0;" >> /var/www/webmail/config/config.inc.php
194
+		echo "\$config['enable_installer'] = false;" >> /var/www/webmail/config/config.inc.php
195
+	fi
196
+
197
+	chown -R www-data:www-data $WEBMAIL_PATH
198
+
199
+	echo 'server {' > /etc/nginx/sites-available/webmail
200
+	echo "  listen 127.0.0.1:$WEBMAIL_ONION_PORT default_server;" >> /etc/nginx/sites-available/webmail
201
+	echo "  server_name $WEBMAIL_ONION_HOSTNAME;" >> /etc/nginx/sites-available/webmail
202
+	echo "  root ${WEBMAIL_PATH};" >> /etc/nginx/sites-available/webmail
203
+	echo '  index index.php index.html index.htm;' >> /etc/nginx/sites-available/webmail
204
+	echo '  access_log off;' >> /etc/nginx/sites-available/webmail
205
+	echo '  error_log off;' >> /etc/nginx/sites-available/webmail
206
+	echo '  location / {' >> /etc/nginx/sites-available/webmail
207
+	echo '    try_files $uri $uri/ /index.php?q=$uri&$args;' >> /etc/nginx/sites-available/webmail
208
+	echo '  }' >> /etc/nginx/sites-available/webmail
209
+	echo '  error_page 404 /404.html;' >> /etc/nginx/sites-available/webmail
210
+	echo '  error_page 500 502 503 504 /50x.html;' >> /etc/nginx/sites-available/webmail
211
+	echo '  location = /50x.html {' >> /etc/nginx/sites-available/webmail
212
+	echo "    root ${WEBMAIL_PATH};" >> /etc/nginx/sites-available/webmail
213
+	echo '  }' >> /etc/nginx/sites-available/webmail
214
+	echo '  location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {' >> /etc/nginx/sites-available/webmail
215
+	echo '    deny all;' >> /etc/nginx/sites-available/webmail
216
+	echo '  }' >> /etc/nginx/sites-available/webmail
217
+	echo '  location ~ ^/(config|temp|logs)/ {' >> /etc/nginx/sites-available/webmail
218
+	echo '    deny all;' >> /etc/nginx/sites-available/webmail
219
+	echo '  }' >> /etc/nginx/sites-available/webmail
220
+	echo '  location ~ /\. {' >> /etc/nginx/sites-available/webmail
221
+	echo '    deny all;' >> /etc/nginx/sites-available/webmail
222
+	echo '    access_log off;' >> /etc/nginx/sites-available/webmail
223
+	echo '    log_not_found off;' >> /etc/nginx/sites-available/webmail
224
+	echo '  }' >> /etc/nginx/sites-available/webmail
225
+	echo '  location ~ \.php$ {' >> /etc/nginx/sites-available/webmail
226
+	echo '    try_files $uri =404;' >> /etc/nginx/sites-available/webmail
227
+	echo '    fastcgi_pass unix:/var/run/php5-fpm.sock;' >> /etc/nginx/sites-available/webmail
228
+	echo '    fastcgi_index index.php;' >> /etc/nginx/sites-available/webmail
229
+	echo '    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> /etc/nginx/sites-available/webmail
230
+	echo '    include fastcgi_params;' >> /etc/nginx/sites-available/webmail
231
+	echo '  }' >> /etc/nginx/sites-available/webmail
232
+	echo '  add_header X-Frame-Options DENY;' >> /etc/nginx/sites-available/webmail
233
+	echo '  add_header X-Content-Type-Options nosniff;' >> /etc/nginx/sites-available/webmail
234
+	echo '  client_max_body_size 15m;' >> /etc/nginx/sites-available/webmail
235
+	echo '}' >> /etc/nginx/sites-available/webmail
236
+
237
+	nginx_ensite webmail
238
+	systemctl restart php5-fpm
239
+	systemctl restart nginx
240
+
241
+	if ! grep -q "Webmail" /home/$MY_USERNAME/README; then
242
+		echo '' >> /home/$MY_USERNAME/README
243
+		echo '' >> /home/$MY_USERNAME/README
244
+		echo 'Webmail' >> /home/$MY_USERNAME/README
245
+		echo '=======' >> /home/$MY_USERNAME/README
246
+		if [[ $ONION_ONLY == 'no' ]]; then
247
+			echo $"Open https://$DEFAULT_DOMAIN_NAME/webmail/index.php" >> /home/$MY_USERNAME/README
248
+		else
249
+			echo $"Open http://$WEBMAIL_ONION_HOSTNAME" >> /home/$MY_USERNAME/README
250
+		fi
251
+		echo $"MariaDB webmail admin password: $WEBMAIL_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
252
+		chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
253
+		chmod 600 /home/$MY_USERNAME/README
254
+	fi
255
+
256
+	echo 'install_webmail' >> $COMPLETION_FILE
238 257
 }
239 258
 
240 259
 # NOTE: deliberately no exit 0

+ 0
- 16
src/freedombone-utils-database View File

@@ -116,22 +116,6 @@ function get_mariadb_password {
116 116
 	fi
117 117
 }
118 118
 
119
-function get_mariadb_media_server_admin_password {
120
-	if [ -f /home/$MY_USERNAME/README ]; then
121
-		if grep -q "Media server administrator password" /home/$MY_USERNAME/README; then
122
-			MEDIA_SERVER_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "Media server administrator password" | awk -F ':' '{print $2}' | sed 's/^ *//')
123
-		fi
124
-	fi
125
-}
126
-
127
-function get_mariadb_webmail_admin_password {
128
-	if [ -f /home/$MY_USERNAME/README ]; then
129
-		if grep -q "MariaDB webmail admin password" /home/$MY_USERNAME/README; then
130
-			WEBMAIL_ADMIN_PASSWORD=$(cat /home/$MY_USERNAME/README | grep "MariaDB webmail admin password" | awk -F ':' '{print $2}' | sed 's/^ *//')
131
-		fi
132
-	fi
133
-}
134
-
135 119
 function install_mariadb {
136 120
 	if grep -Fxq "install_mariadb" $COMPLETION_FILE; then
137 121
 		return