Fix sed regexes
This commit is contained in:
parent
1668f8e992
commit
d953c282f2
@ -40,17 +40,19 @@ mv crs-setup.conf.example %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/crs-set
|
||||
|
||||
%post
|
||||
# activate base_rules
|
||||
for f in `ls %{buildroot}%{_datarootdir}/mod_modsecurity_crs/rules/` ; do
|
||||
ln -s %{_datarootdir}/mod_modsecurity_crs/rules/$f %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f;
|
||||
for f in `ls %{_datarootdir}/mod_modsecurity_crs/rules/` ; do
|
||||
ln -s %{_datarootdir}/mod_modsecurity_crs/rules/$f %{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f;
|
||||
done
|
||||
|
||||
sed '/Include(Optional)? modsecurity.d\/\*\.conf/a\tInclude$1 modsecurity.d/plugins/*-config.conf\n\tInclude$1 modsecurity.d/plugins/*-before.conf' %{_httpd_confdir}/mod_security.conf
|
||||
sed '/Include(Optional)? modsecurity.d\/local_rules\/\*\.conf/a\tInclude$1 modsecurity.d/plugins/*-after.conf' %{_httpd_confdir}/mod_security.conf
|
||||
sed -i '/IncludeOptional modsecurity\.d\/\*\.conf/ a\ IncludeOptional modsecurity.d\/plugins\/*-config.conf\n IncludeOptional modsecurity.d\/plugins\/*-before.conf' %{_httpd_confdir}/mod_security.conf
|
||||
sed -i '/Include modsecurity\.d\/\*\.conf/a\ Include modsecurity.d/plugins/*-config.conf\n Include modsecurity.d/plugins/*-before.conf' %{_httpd_confdir}/mod_security.conf
|
||||
sed -i '/IncludeOptional modsecurity\.d\/local_rules\/\*\.conf/a\ IncludeOptional modsecurity.d\/plugins\/*-after.conf' %{_httpd_confdir}/mod_security.conf
|
||||
sed -i '/Include modsecurity\.d\/local_rules\/\*\.conf/a\ Include modsecurity.d\/plugins\/*-after.conf' %{_httpd_confdir}/mod_security.conf
|
||||
|
||||
%postun
|
||||
sed '/Include(Optional)? modsecurity.d\/plugins/d' %{_httpd_confdir}/mod_security.conf
|
||||
for f in `ls %{buildroot}%{_datarootdir}/mod_modsecurity_crs/rules/` ; do
|
||||
%{__rm} %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f;
|
||||
sed -iE '/Include(Optional)? modsecurity.d\/plugins/d' %{_httpd_confdir}/mod_security.conf
|
||||
for f in `ls %{_datarootdir}/mod_modsecurity_crs/rules/` ; do
|
||||
%{__rm} %{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f;
|
||||
done
|
||||
|
||||
%files
|
||||
|
Loading…
Reference in New Issue
Block a user