欢迎各位兄弟 发布技术文章
这里的技术是共享的
#!/bin/bash
#
for file in /home/wwwroot/*/public_html/public ;do
if [ -d "$file" -a -f "${file}/.htaccess" ];then
HTACCESS=${file}/.htaccess
sed -i '$a \order deny,allow \n SetEnvIf X-Forwarded-for "0.0.0.0" DenyAccess \n Deny from env=DenyAccess ' $HTACCESS
sed -i 's/\r$//g' $HTACCESS
fi
done