forked from threathunterX/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ctrl.sh
executable file
·63 lines (54 loc) · 986 Bytes
/
ctrl.sh
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
#!/bin/bash
install()
{
echo 'start install nebula.....'
echo `docker-compose down `
echo `docker-compose up -d `
echo 'import db data.....'
sleep 15
nebula_db_id=`docker ps | grep -w 'nebula-db' | awk '{print $1}'`
echo 'run id:' $nebula_db_id
echo `docker cp ./scripts/db/initdb.sh $nebula_db_id:/tmp/initdb.sh`
echo `docker cp ./scripts/db/nebula.init.data.sql $nebula_db_id:/tmp/nebula.init.data.sql`
echo `docker-compose exec nebula-db bash /tmp/initdb.sh`
sleep 5
echo `docker-compose down`
echo 'done.'
}
start()
{
echo 'start nebula.....'
echo `docker-compose up -d `
}
stop()
{
echo 'stop nebula.....'
echo `docker-compose down `
}
status()
{
docker-compose ps
docker-compose exec nebula supervisorctl status
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
install)
install
;;
*)
echo "Usage: $0 {start|restart|stop}"
exit 1
;;
esac