blob: b8e814a455e194e6b812f3ae4a987dcdb086d1a5 (
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
|
post_install() {
echo -e '\nTo activate use: \nsystemctl enable --now tuptime.service tuptime-sync.timer \n'
/usr/bin/systemd-sysusers
local dir='/var/lib/tuptime'
if [ ! -d ${dir} ]; then
mkdir -p ${dir}
fi
chown -R _tuptime:_tuptime ${dir}
chmod 0755 ${dir}
}
post_upgrade() {
if id tuptime &>/dev/null; then
echo -e '\nUser "tuptime" was replaced with "_tuptime", you may remove it. \n'
fi
/usr/bin/systemd-sysusers
local dir='/var/lib/tuptime'
if [ -d ${dir} ]; then
local owner=$(stat -c %U%G ${dir})
if [[ "${owner}" != "_tuptime_tuptime" ]]; then
chown -R _tuptime:_tuptime ${dir}
chmod 0755 ${dir}
fi
else
mkdir -p ${dir}
chown _tuptime:_tuptime ${dir}
chmod 0755 ${dir}
fi
}
post_remove() {
if [ -d /var/lib/tuptime ]; then
rm -rf /var/lib/tuptime
fi
if id _tuptime &>/dev/null; then
userdel -f _tuptime
fi
}
|