feat : config

This commit is contained in:
2024-11-06 11:08:32 +08:00
parent 07d9c87788
commit 7ae017892f
4 changed files with 79 additions and 0 deletions

21
restart_prod.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
HomeDir=/home/production/api_server
#先判断是否存在某个文件构建配置文件
if [ -e $HomeDir/../cron_true.txt ]; then
rm -rf $HomeDir/.env
cp $HomeDir/env.prod $HomeDir/.env
else
rm -rf $HomeDir/.env
cp $HomeDir/env.prod $HomeDir/.env
fi
#杀死进程并重启进程
sudo lsof -i:9501|grep -v PID|awk '{print $2}'|sudo xargs kill -9
echo 'kill success';