110110[[ $C_NGINX_CONFIG_ARGS == * --with-http_xslt_module* ]] && require_pkg " libxslt1-dev"
111111[[ $C_NGINX_CONFIG_ARGS == * ssl* ]] && require_pkg " libssl-dev"
112112
113+
114+ # ###[ Main ]################################################################################
115+
116+
117+ read -rp " ${C_NOTE} We will now install and configure ModSecurity. Press [Enter] to continue."
118+
119+ # ##
120+ # ## [ Install Required Packages ]
121+ # ##
122+
113123for pkg in " ${required_pkgs[@]} " ; do
114124 if ! dpkg -s " $pkg " & > /dev/null; then
115125 missing_pkgs+=(" $pkg " )
@@ -118,16 +128,10 @@ done
118128
119129if (( ${# missing_pkgs[@]} > 0 )) ; then
120130 echo " ${C_INFO} Installing missing packages: ${missing_pkgs[*]} "
121- sudo apt get update
122- sudo apt get install -y " ${missing_pkgs[@]} "
131+ sudo apt- get update
132+ sudo apt- get install -y " ${missing_pkgs[@]} "
123133fi
124134
125-
126- # ###[ Main ]################################################################################
127-
128-
129- read -rp " ${C_NOTE} We will now install and configure ModSecurity. Press [Enter] to continue."
130-
131135# ##
132136# ## [ Clone and build ModSecurity ]
133137# ##
@@ -271,7 +275,9 @@ sudo systemctl restart nginx
271275echo " ${C_SUCC} Finished installing and configuring ModSecurity WAF for Nginx"
272276cat << EOF
273277${C_NOTE} To enable ModSecurity WAF for a site, add these lines to its Nginx server block, for example in '/etc/nginx/sites-enabled/':
274- ${C_CYAN} ## Modsecurity settings
275- modsecurity on;
276- modsecurity_rules_file /etc/nginx/modsec/main.conf;${C_NC}
278+ ${C_CYAN}
279+ ## Modsecurity settings
280+ modsecurity on;
281+ modsecurity_rules_file /etc/nginx/modsec/main.conf;
282+ ${C_NC}
277283EOF
0 commit comments