开关缓存

Signed-off-by: HITSword <admin@huayizhiyun.com>
master
HITSword 2020-01-17 21:43:48 +08:00
parent bdb45d126b
commit 2a7264c444
1 changed files with 10 additions and 2 deletions

View File

@ -105,10 +105,18 @@ function amh_module_admin()
amh nginx reload;
;;
start-cache)
echo "start cache";
RES=`php ${module_dir}cli.php --action='edit' --server_name=${domain} --field_name='proxy_cache' --value='1'`;
echo $RES;
if ! echo "$RES" | grep 'Error' > /dev/null; then
kill -HUP `cat /usr/local/nginx/logs/nginx.pid` && echo "[OK] successfully start-cache $domain " && exit;
fi;
;;
stop-cache)
echo "stop cache";
RES=`php ${module_dir}cli.php --action='edit' --server_name=${domain} --field_name='proxy_cache' --value='0'`;
echo $RES;
if ! echo "$RES" | grep 'Error' > /dev/null; then
kill -HUP `cat /usr/local/nginx/logs/nginx.pid` && echo "[OK] successfully stop-cache $domain " && exit;
fi;
;;
cache)
echo "[Notice] 暂不支持缓存配置";