Refactor nginx management to use helper

Replace direct nginx systemctl/ln calls with the `nginx_enable_site` helper function across multiple update scripts. Also use `get_php_fpm_socket` in paymenter.sh for dynamic PHP socket path instead of hardcoded version string.
This commit is contained in:
MickLesk
2026-07-28 15:02:51 +02:00
parent b7688ff97a
commit af111bf419
6 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ server {
}
}
EOF
systemctl reload nginx
nginx_enable_site dispatcharr.conf
msg_ok "Migrated Nginx Configuration"
fi
+1 -3
View File
@@ -59,9 +59,7 @@ function update_script() {
envsubst </opt/feishin/settings.js.template >/etc/nginx/conf.d/settings.js
envsubst '${PUBLIC_PATH}' </opt/feishin/ng.conf.template >/etc/nginx/sites-available/feishin
ln -sf /etc/nginx/sites-available/feishin /etc/nginx/sites-enabled/feishin
rm -f /etc/nginx/sites-enabled/default
systemctl restart nginx
nginx_enable_site feishin
msg_ok "Published Web Assets"
msg_ok "Updated successfully!"
+3 -2
View File
@@ -34,8 +34,9 @@ function update_script() {
if [[ "$CURRENT_PHP" != "8.3" ]]; then
PHP_VERSION="8.3" PHP_FPM="YES" setup_php
setup_composer
sed -i 's|php8\.2-fpm\.sock|php8.3-fpm.sock|g' /etc/nginx/sites-available/paymenter.conf
$STD systemctl reload nginx
PHP_SOCK=$(get_php_fpm_socket)
sed -i "s|fastcgi_pass unix:.*|fastcgi_pass unix:${PHP_SOCK};|" /etc/nginx/sites-available/paymenter.conf
nginx_enable_site paymenter.conf
fi
if check_for_gh_release "paymenter" "paymenter/paymenter"; then
+2 -2
View File
@@ -62,9 +62,9 @@ function update_script() {
msg_ok "Updated Configuration"
msg_info "Starting Services"
$STD nginx -t
systemctl daemon-reload
systemctl start nginx rackula-api
nginx_enable_site rackula
systemctl start rackula-api
msg_ok "Started Services"
msg_ok "Updated successfully!"
fi
+1 -1
View File
@@ -75,7 +75,7 @@ function update_script() {
systemctl reload angie
elif [[ -f /etc/nginx/sites-available/romm ]]; then
sed -i "s|alias .*/library/;|alias ${ROMM_BASE}/library/;|" /etc/nginx/sites-available/romm
systemctl reload nginx
nginx_enable_site romm
fi
msg_ok "Updated ROMM"
+2 -1
View File
@@ -93,7 +93,8 @@ EOF
msg_ok "Refreshed SparkyFitness Service"
msg_info "Starting Services"
$STD systemctl start sparkyfitness-server nginx
$STD systemctl start sparkyfitness-server
nginx_enable_site sparkyfitness
msg_ok "Started Services"
msg_ok "Updated successfully!"
fi