#!/bin/bash
echo "update supervisor.config !"
if [ ! -d "/usr/local/pys/" ];then
mkdir -p /usr/local/pys/
else
echo "文件夹/usr/local/pys已经存在"
fi
cd /usr/local/pys/
for file in $(ls *)
do
python $file
done
echo "没有需要执行的py脚本"
cd /etc/nginx/conf.d
for file in $(ls *)
do
mkdir -p /etc/nginx/conf.d.bak/
cp -rf $file ../conf.d.bak/$file.bak
done
sed -i "s/#PB_GATEWAY/$PB_GATEWAY/g" `grep \#PB_GATEWAY -rl /etc/nginx/conf.d`
sed -i "s/#IFRAME_ENTRY/$IFRAME_ENTRY/g" `grep \#IFRAME_ENTRY -rl /etc/nginx/conf.d`
sed -i "s/#IFRAME_PTS/$IFRAME_PTS/g" `grep \#IFRAME_PTS -rl /etc/nginx/conf.d`
sed -i "s/#PB_GATEWAY/$PB_GATEWAY/g" `grep \#PB_GATEWAY -rl /home/soft/`
sed -i "s/#IP_ADDR/$IP_ADDR/g" `grep \#IP_ADDR -rl /home/soft/`
time=$(date "+%Y-%m-%d %H:%M:%S")
filePath="/usr/project/supervisor_file.cfg"
if [ ! -f "$filePath" ];then
supervisorctl update all
sleep 10s
supervisorctl reload
touch $filePath
echo $time > $filePath
echo "成功创建认证文件"
else
echo "已存在认证文件"
fi
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)