We add a few variables to help clean things if the install fails

This commit is contained in:
Papa Dragon 2023-02-28 19:22:07 +01:00
parent 932b8a2337
commit 6c30d795fa
2 changed files with 6 additions and 0 deletions

View file

@ -142,6 +142,7 @@ function add_nginx_conf {
print_info "adding nginx conf files"
sed "s|SERVER_NAME|${domain_name}|g;s|INSTALL_PATH|${install_path}|g;s|SERVER_LOG|${domain_name}.log|;s|DOMAIN_CERT|${cert}|;s|CERT_KEY|${cert_key}|;" nginx-server.conf.template >> /etc/nginx/sites-available/${domain_name}.conf
ln -s /etc/nginx/sites-available/${domain_name}.conf /etc/nginx/sites-enabled/
nginx_conf=yes
systemctl restart nginx
}
@ -237,6 +238,7 @@ function create_website_db {
Q4="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}${Q4}"
mysql -uroot -e $opt_mysqlpass "$SQL"
db_installed=yes
else
die "database user named \"$website_db_user\" already exists..."
fi
@ -328,6 +330,7 @@ function install_website {
chown -R www-data:www-data $install_path
chown root:www-data $install_path/
print_info "installed addons"
db_installed=yes
}
function configure_daily_update {
@ -344,6 +347,7 @@ function configure_daily_update {
echo "chmod 0644 $install_path/.htaccess # www-data can read but not write it" >> /var/www/$daily_update
fi
chmod a+x /var/www/$daily_update
daily_update_exists=yes
}
function configure_cron_daily {

View file

@ -75,6 +75,7 @@ function add_vhost {
echo " </Directory>" >> "/etc/apache2/sites-available/${domain_name}.conf"
echo "</VirtualHost>" >> "/etc/apache2/sites-available/${domain_name}.conf"
a2ensite $domain_name
vhost_added=yes
}
function install_letsencrypt {
@ -103,6 +104,7 @@ function vhost_le {
print_info "run certbot ..."
certbot --apache -w $install_path -d $domain_name -m $le_email --agree-tos --non-interactive --redirect --hsts --uir
service apache2 restart
vhost_le_confgured=yes
}
function install_mysql {