diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh index ba3335d..d5e30b8 100644 --- a/scripts/fluidd.sh +++ b/scripts/fluidd.sh @@ -77,6 +77,8 @@ function install_fluidd() { set_upstream_nginx_cfg ### create /etc/nginx/sites-available/ set_nginx_cfg "fluidd" + ### nginx on ubuntu 21 and above needs special permissions to access the files + set_nginx_permissions ### symlink nginx log symlink_webui_nginx_log "fluidd" diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh index bdefd48..16d64d1 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -77,6 +77,8 @@ function install_mainsail() { set_upstream_nginx_cfg ### create /etc/nginx/sites-available/ set_nginx_cfg "mainsail" + ### nginx on ubuntu 21 and above needs special permissions to access the files + set_nginx_permissions ### symlink nginx log symlink_webui_nginx_log "mainsail" diff --git a/scripts/nginx.sh b/scripts/nginx.sh index 56cd0f8..e62d3b5 100644 --- a/scripts/nginx.sh +++ b/scripts/nginx.sh @@ -284,6 +284,20 @@ function set_nginx_cfg() { fi } +function set_nginx_permissions() { + local distro_name version_id + + distro_name=$(grep -E "^NAME=" /etc/os-release | cut -d'"' -f2) + version_id=$(grep -E "^VERSION_ID=" /etc/os-release | cut -d'"' -f2) + + if [[ ${distro_name} == "Ubuntu" && ( ${version_id} == "21.10" || ${version_id} == "22.04") ]]; then + status_msg "Granting NGINX the required permissions ..." + chmod og+x "${HOME}" && ok_msg "Done!" + fi + + return +} + function read_listen_port() { local port interface=${1} port=$(grep listen "/etc/nginx/sites-enabled/${interface}" | head -1 | sed 's/^\s*//' | cut -d" " -f2 | cut -d";" -f1)