Skip to content

Commit

Permalink
remove redundant echo & 440 sudoer file
Browse files Browse the repository at this point in the history
  • Loading branch information
hsntgm authored Jul 12, 2024
1 parent fe24f0a commit 16bb853
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fastcgi_ops_root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ grant_sudo_perm_systemctl_for_php_process_owner() {
PERMISSIONS="${user} ALL=(ALL) NOPASSWD: ${SYSTEMCTL_PATH} start ${service_file_new##*/}, ${SYSTEMCTL_PATH} stop ${service_file_new##*/}, ${SYSTEMCTL_PATH} status ${service_file_new##*/}"
echo "${PERMISSIONS}" | sudo EDITOR='tee -a' visudo -f "${includedir_path}/${NPP_SUDOERS}" > /dev/null 2>&1 || { echo -e "\e[91mFailed to grant permission for npp-wordpress systemd service to PHP-FPM user: ${user}\e[0m"; return 1; }
done
chmod 0440 "${includedir_path}/${NPP_SUDOERS}"
fi
else
return 1
Expand Down Expand Up @@ -671,7 +672,6 @@ if [[ -f "${this_script_path}/manual-configs.nginx" ]]; then
check_and_start_systemd_service && touch "${this_script_path}/manual_setup_on"
print_nginx_cache_paths
if grant_sudo_perm_systemctl_for_php_process_owner; then
echo ""
echo -e "\e[92mSuccess:\e[0m sudo privileges granted for systemd service \e[93mnpp-wordpress\e[0m to PHP-FPM users"
for user in "${!fcgi[@]}"; do
echo -e "User: \e[93m${user}\e[0m is a passwordless sudoer to manage the systemd service \e[93mnpp-wordpress\e[0m"
Expand Down Expand Up @@ -725,7 +725,6 @@ else
check_and_start_systemd_service && touch "${this_script_path}/auto_setup_on"
print_nginx_cache_paths
if grant_sudo_perm_systemctl_for_php_process_owner; then
echo ""
echo -e "\e[92mSuccess:\e[0m sudo privileges granted for systemd service \e[93mnpp-wordpress\e[0m to PHP-FPM users"
for user in "${!fcgi[@]}"; do
echo -e "User: \e[93m${user}\e[0m is a passwordless sudoer to manage the systemd service \e[93mnpp-wordpress\e[0m"
Expand Down

0 comments on commit 16bb853

Please sign in to comment.