blob: b65fc5040178d4a1e92ad36ee370593f744babcc (
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
|
post_install() {
if [ ! -f /etc/gingertechengine/checks.json ]; then
echo "Making default check file"
mv /etc/gingertechengine/example.json /etc/gingertechengine/checks.json
fi
if [ ! -f /etc/gingertechengine/gogios.toml ]; then
echo "Making default config"
cp /etc/gingertechengine/gogios.sample.toml /etc/gingertechengine/gogios.toml
fi
if id "gogios" >/dev/null 2>&1; then
echo "gogios user already exists"
else
useradd --system --no-create-home --shell /sbin/nologin gogios
fi
chown gogios:gogios -R /var/log/gingertechnology
chown gogios:gogios -R /usr/lib/gingertechengine
chown gogios:gogios -R /etc/gingertechengine
chown gogios:gogios -R /opt/gingertechengine
}
post_upgrade() {
post_install
systemctl restart gogios
}
pre_remove() {
systemctl stop gogios
systemctl disable gogios
}
|