-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhelper.sh
executable file
·79 lines (63 loc) · 1.57 KB
/
helper.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
check()
{
list="110 995 143 993 25 465 587 20 21 80 443 8080 2222"
for i in $list ; do
netcat -vz 127.0.0.1 $i >/dev/null 2>&1
ret=$?
echo "checking port: <$i> $ret"
done
}
if [ "$1" = "" ] ; then
echo " usage: `basename $0` check|build|config|rerun"
exit 0
fi
if [ "$1" = "check" ] ; then
check
exit 0
fi
if [ "$1" = "build" ] ; then
sudo /etc/init.d/vmware-workstation-server stop
sudo rm -Rvf ./volumes
cp -v ./docker-compose.yml-template ./docker-compose.yml
./do stop
./do rm
./do build
./do up
sleep 3
./do log
check
fi
if [ "$1" = "config" ] ; then
./do track init # initialize tracking for /etc and /usr/local/ispconfig
./do config mysql_root_pw test # change mysql root password to test
./do config panal_admin_pw test # set panel admin password to test
./do config server_name myhost.test.com # set server name in ispconfig database
./do restart ; sleep 3 ; ./do log # restart ispconfig
./do track show # show ispconfig file modifications
./helper.sh check
fi
if [ "$1" = "rerun" ] ; then
./do migrate export
./do stop
./do rm
./do up
sleep 3
./do log
./do migrate import
./do restart
sleep 3
./do log
./helper.sh check
exit 0
fi
if [ "$1" = "rebuild" ] ; then
./do migrate export
./do stop ; ./do rm
./do build
./do up ; sleep 3 ; ./do log
./do migrate import
./do restart ; sleep 3 ; ./do log
./helper.sh check
exit 0
fi