blob: a53c7ac4881e2d3fbb677fb16a8eb0025a2cac4a (
plain)
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
|
pre_install() {
if [ `sed -n "/^omada/p" /etc/passwd` ]
then
echo "User omada already exists"
else
sudo useradd omada
echo "User omada has beed created"
fi
}
post_install() {
if [ `sed -n "/^omada/p" /etc/passwd` ]
then
echo "User omada already exists"
else
sudo useradd omada
echo "User omada has beed created"
fi
sudo chown omada:omada -R /var/lib/omada-controller
sudo chown omada:omada -R /opt/omada-controller
sudo sed -i 's/-root/-omada/g' /opt/omada-controller/bin/control.sh
sudo systemctl enable omada-controller
}
pre_remove() {
sudo systemctl stop omada-controller
sudo systemctl disable omada-controller
}
post_remove() {
sudo rm -Rf /opt/omada-controller/bin
sudo rm -Rf /opt/omada-controller/lib
sudo rm -Rf /opt/omada-controller/logs
sudo rm -Rf /opt/omada-controller/properties
}
pre_upgrade() {
sudo systemctl stop omada-controller
}
post_upgrade() {
sudo rm -rf opt/omada-controller/data
sudo rm -rf /opt/omada-controller/logs
sudo rm -rf /opt/omada-controller/work
sudo ln -s /var/lib/omada-controller/data /opt/omada-controller
sudo ln -s /var/lib/omada-controller/logs /opt/omada-controller
sudo ln -s /var/lib/omada-controller/work /opt/omada-controller
sudo chown omada:omada -R /opt/omada-controller
sudo systemctl daemon-reload
sudo systemctl start omada-controller
}
|