forked from jumpserver/setuptools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjmsctl.sh
More file actions
executable file
·71 lines (65 loc) · 1.51 KB
/
jmsctl.sh
File metadata and controls
executable file
·71 lines (65 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env bash
#
BASE_DIR=$(cd "$(dirname "$0")";pwd)
PROJECT_DIR=${BASE_DIR}
SCRIPT_DIR=${BASE_DIR}/scripts
action=$1
if [ ! -f "$PROJECT_DIR/config.conf" ]; then
echo -e "Error: No config file found."
echo -e "You can run 'cp config_example.conf config.conf', and edit it."
exit 1
fi
source ${PROJECT_DIR}/config.conf
function usage() {
echo "JumpServer 部署安装脚本"
echo
echo "Usage: "
echo " jmsctl [COMMAND] ..."
echo " jmsctl -h --help"
echo
echo "Commands: "
echo " install 安装 JumpServer"
echo " start 启动 JumpServer"
echo " stop 停止 JumpServer"
echo " restart 重启 JumpServer"
echo " status 检查 JumpServer"
echo " uninstall 卸载 JumpServer"
echo " upgrade 升级 JumpServer"
}
function main() {
case "${action}" in
install)
bash ${SCRIPT_DIR}/install.sh
;;
uninstall)
bash ${SCRIPT_DIR}/uninstall.sh
;;
upgrade)
bash ${SCRIPT_DIR}/upgrade.sh
;;
start)
bash ${SCRIPT_DIR}/start.sh
;;
stop)
bash ${SCRIPT_DIR}/stop.sh
;;
restart)
bash ${SCRIPT_DIR}/stop.sh
bash ${SCRIPT_DIR}/start.sh
;;
status)
bash ${SCRIPT_DIR}/install_status.sh
;;
--help)
usage
;;
-h)
usage
;;
*)
echo -e "jmsctl: unknown option: '$action'"
echo -e "See 'jmsctl --help' \n"
usage
esac
}
main