Linux下的Zen Cart安全脚本
#!/bin/bash
echo "install some setting for zen cart because of some secure reason..."
for site in /data0/htdocs/*;do
if [ -d $site ]; then
if [ -f $site/includes/application_top.php ]; then
echo $site" is zen cart folder"
chmod 444 -R $site/docs
chmod 444 -R $site/extras
chmod 444 $site/install.txt
rm -rf $site/download
rm -rf $site/media
rm -rf $site/pub
for zi in `ls $site |grep zc_install`; do
echo "found zc_install and delete it"
rm -rf $site/$zi
done
echo "dropping "$site"/admin/password_forgotten.php"
rm -f $site/admin/password_forgotten.php
#echo "setting init_header.php..."
ls $site/includes/init_includes/init_header.php
sed -i $site/includes/init_includes/init_header.php -e "s/'WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true'/'WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'false'/g"
fi
fi
done
echo "install some setting for zen cart because of some secure reason..."
for site in /data0/htdocs/*;do
if [ -d $site ]; then
if [ -f $site/includes/application_top.php ]; then
echo $site" is zen cart folder"
chmod 444 -R $site/docs
chmod 444 -R $site/extras
chmod 444 $site/install.txt
rm -rf $site/download
rm -rf $site/media
rm -rf $site/pub
for zi in `ls $site |grep zc_install`; do
echo "found zc_install and delete it"
rm -rf $site/$zi
done
echo "dropping "$site"/admin/password_forgotten.php"
rm -f $site/admin/password_forgotten.php
#echo "setting init_header.php..."
ls $site/includes/init_includes/init_header.php
sed -i $site/includes/init_includes/init_header.php -e "s/'WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true'/'WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'false'/g"
fi
fi
done
相关推荐
sduliding 2020-07-13
ithzhang 2019-12-26
架构技术交流 2019-11-11
骷髅狗 2014-01-09
Linroid 2019-10-26
zyhui 2014-05-20
zhangpeng 2013-01-17
lansura 2012-02-22
wolaizheli 2011-07-13
JimiWu 2019-06-14
芒果先生Mango 2014-01-09
sduliding 2017-06-20
yangjianren0 2017-03-09
weiyang 2017-03-07
Duriansir 2016-07-11
oQiuQian 2016-07-05
sduliding 2016-08-18