refactoring changes from sequpgrade (endReturn, ...) and some modernizations
This commit is contained in:
@@ -6,7 +6,7 @@ phpVersion="7.3"
|
||||
phpName="php$phpVersion"
|
||||
phpPackages="${phpName}-fpm ${phpName}-json ${phpName}-mysql ${phpName}-curl ${phpName}-intl ${phpName}-gd ${phpName}-zip ${phpName}-xml ${phpName}-mbstring php-imagick php-apcu"
|
||||
|
||||
step_1_info() {
|
||||
step_1_info() {
|
||||
echo "Installation of $serverName packages:"
|
||||
echoinfo "$serverPackages"
|
||||
}
|
||||
@@ -14,7 +14,7 @@ step_1_alias() { echo "install"; }
|
||||
step_1() {
|
||||
exe apt update
|
||||
exe apt install $serverPackages
|
||||
endReturn -o $? "Server package installation error"
|
||||
endReturn "Server package installation error"
|
||||
}
|
||||
|
||||
step_2_info() { echo "Basic nginx configuration for initial letsencrypt certificate creation"; }
|
||||
@@ -31,12 +31,12 @@ step_2() {
|
||||
exe apt install nginx
|
||||
fi
|
||||
|
||||
# create webroot
|
||||
# create webroot
|
||||
exe mkdir -p "$siteLetsencryptWww"
|
||||
|
||||
echo -n " [I] Restarting Nginx ... "
|
||||
exe service nginx restart && echo "ok"
|
||||
endReturn -o $? "Nginx error during startup"
|
||||
endReturn "Nginx error during startup"
|
||||
}
|
||||
snippetLetsencryptLoc="/etc/nginx/snippets/letsencrypt.conf"
|
||||
siteLetsencryptWww="/var/www/letsencrypt"
|
||||
@@ -49,7 +49,7 @@ siteDefaultLoc="/etc/nginx/sites-available/default"
|
||||
siteDefaultIp4="server {
|
||||
listen 80 default_server;
|
||||
|
||||
include ${snippetLetsencryptLoc};
|
||||
include ${snippetLetsencryptLoc};
|
||||
}"
|
||||
|
||||
step_3_info() {
|
||||
@@ -58,7 +58,7 @@ step_3_info() {
|
||||
}
|
||||
step_3() {
|
||||
exe apt install $phpPackages
|
||||
endReturn -o $? "$phpName error during startup"
|
||||
endReturn "$phpName error during startup"
|
||||
}
|
||||
phpFpmConfigLocation="/etc/php/${phpVersion}/fpm/conf.d/90-custom_pi.ini"
|
||||
phpFpmConfig="\
|
||||
@@ -88,7 +88,7 @@ step_4() {
|
||||
|
||||
echo -n "Restarting ${phpName} ..."
|
||||
exe service ${phpName}-fpm restart
|
||||
endReturn -o $? "$phpName error during restart"
|
||||
endReturn "$phpName error during restart"
|
||||
echo "ok"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user