mirror of https://github.com/jumpserver/jumpserver
更新升级脚本
parent
5c7acae018
commit
abd20f31b8
|
@ -1,10 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ ! -d "/opt/py3" ]; then
|
if [ ! -d "/opt/py3" ]; then
|
||||||
echo -e "\033[31m python3虚拟路径不正确 \033[0m"
|
echo -e "\033[31m python3虚拟环境不是默认路径 \033[0m"
|
||||||
echo -e "\033[31m 请手动修改虚拟环境的位置 \033[0m"
|
ps -ef | grep jumpserver/tmp/beat.pid | grep -v grep
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
echo -e "\033[31m jumpserver未运行,请到jumpserver目录使用 ./jms start all -d 启动 \033[0m"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
|
echo -e "\033[31m 正在计算python3虚拟环境路径 \033[0m"
|
||||||
|
fi
|
||||||
|
py3pid=`ps -ef | grep jumpserver/tmp/beat.pid | grep -v grep | awk '{print $2}'`
|
||||||
|
py3file=`cat /proc/$py3pid/cmdline`
|
||||||
|
py3even=`echo ${py3file%/bin/python3*}`
|
||||||
|
echo -e "\033[31m python3虚拟环境路径为$py3even \033[0m"
|
||||||
|
source $py3even/bin/activate
|
||||||
|
else
|
||||||
source /opt/py3/bin/activate
|
source /opt/py3/bin/activate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -37,6 +48,8 @@ fi
|
||||||
|
|
||||||
git pull && pip install -r requirements/requirements.txt && cd utils && sh make_migrations.sh
|
git pull && pip install -r requirements/requirements.txt && cd utils && sh make_migrations.sh
|
||||||
|
|
||||||
|
cd .. && ./jms start all -d
|
||||||
|
echo -e "\033[31m 请检查jumpserver是否启动成功 \033[0m"
|
||||||
echo -e "\033[31m 备份文件存放于$jumpserver_backup目录 \033[0m"
|
echo -e "\033[31m 备份文件存放于$jumpserver_backup目录 \033[0m"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue