1 Star 0 Fork 0

gtinlian/vmbox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
start.sh 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
gtinlian 提交于 2024-06-16 13:13 . feat: 启动安卓程序
#!/bin/bash
function check(){
if [ ! -d "nginx" ];then
echo "未安装nginx,请执行install脚本安装"
exit
fi
}
function start(){
check
if [ -d .env ];then
. .env/bin/activate
fi
## 启动django 和 websockify
cd vmbox-api/
nohup python3 run.py &> ./logs.log &
cd ../ws-scrcpy
nohup node dist/index.js &> ./logs.log &
## 启动nginx
cd ../nginx
./sbin/nginx
cd ..
}
function stop() {
check
ps aux|grep -E 'python3 run.py|python -m websockify|scrcpy' |grep -v 'grep' | awk '{print "kill "$2}' | bash
cd nginx
./sbin/nginx -s stop
cd ..
}
function ng() {
cd nginx
if [ "$1" == "start" ];then
./sbin/nginx
else
./sbin/nginx -s $1
fi
}
case $1 in
start)
start
echo "[start OK]"
exit
;;
esac
case $1 in
stop)
stop
echo "[stop OK]"
exit
;;
esac
case $1 in
restart)
stop
echo "[stop OK]"
start
echo "[start OK]"
echo "[restart OK]"
exit
;;
ng)
ng $2
echo "[nginx OK]"
exit
;;
esac
echo -e '\n请输入参数!\n \ncommand: start.sh [start|stop|restart|ng ${nginxOption}]\n\t\tginxOption: \n\t\t\t [stop|restart]'
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/gtinlian/vmbox.git
git@gitee.com:gtinlian/vmbox.git
gtinlian
vmbox
vmbox
master

搜索帮助