Skip to content

Commit 343262d

Browse files
authored
Merge pull request #55 from it-novum/issue-54
Resolve #54
2 parents 96d9fc1 + 1b310d5 commit 343262d

File tree

4 files changed

+30
-10
lines changed

4 files changed

+30
-10
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.3
1+
3.0.5

build/package/postinst.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ set -u
1111
if [ -f /usr/bin/openitcockpit-agent ]; then
1212

1313
if [ -x "$(command -v systemctl)" ]; then
14-
if [ ! -f /lib/systemd/system/openitcockpit-agent.service ]; then
15-
if [ -d /lib/systemd/system/ ]; then
16-
# Debian / Ubuntu / Arch
14+
if [ -d /lib/systemd/system/ ]; then
15+
# Debian / Ubuntu / Arch
16+
if [ ! -f /lib/systemd/system/openitcockpit-agent.service ]; then
1717
ln /etc/openitcockpit-agent/init/openitcockpit-agent.service /lib/systemd/system/openitcockpit-agent.service
18-
elif [ -d /usr/lib/systemd/system/ ]; then
19-
# RedHat / Suse
18+
fi
19+
elif [ -d /usr/lib/systemd/system/ ]; then
20+
# RedHat / Suse
21+
if [ ! -f /usr/lib/systemd/system/openitcockpit-agent.service ]; then
2022
ln /etc/openitcockpit-agent/init/openitcockpit-agent.service /usr/lib/systemd/system/openitcockpit-agent.service
2123
fi
2224
fi

build/package/prerm.sh

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ if [ -f /usr/bin/openitcockpit-agent ]; then
1515
/bin/systemctl -a | grep openitcockpit-agent >/dev/null
1616
RC=$?
1717
if [ "$RC" -eq 0 ]; then
18-
/bin/systemctl stop openitcockpit-agent
19-
/bin/systemctl disable openitcockpit-agent
18+
19+
if [ "$1" -eq "0" ] || [ "$1" = "purge" ] || [ "$1" = "remove" ] ; then
20+
# Uninstall on CentOS / Debian / Ubuntu
21+
/bin/systemctl stop openitcockpit-agent
22+
/bin/systemctl disable openitcockpit-agent
23+
fi
24+
2025
fi
2126
else
2227
service openitcockpit-agent stop
@@ -31,7 +36,20 @@ if [ -f /usr/bin/openitcockpit-agent ]; then
3136
fi
3237

3338
fi
34-
rm -f /etc/init.d/openitcockpit-agent /lib/systemd/system/openitcockpit-agent.service /usr/lib/systemd/system/openitcockpit-agent.service /var/log/openitcockpit-agent
39+
40+
if [ "$1" -eq "0" ]; then
41+
# Uninstall on CentOS
42+
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
43+
# https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets
44+
rm -f /etc/init.d/openitcockpit-agent /lib/systemd/system/openitcockpit-agent.service /usr/lib/systemd/system/openitcockpit-agent.service /var/log/openitcockpit-agent
45+
fi
46+
47+
if [ "$1" = "purge" ] || [ "$1" = "remove" ] ; then
48+
# Uninstall on Debian / Ubuntu
49+
# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
50+
rm -f /etc/init.d/openitcockpit-agent /lib/systemd/system/openitcockpit-agent.service /usr/lib/systemd/system/openitcockpit-agent.service /var/log/openitcockpit-agent
51+
fi
52+
3553
set -e
3654

3755
fi

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
// AgentVersion as the name says
17-
const AgentVersion = "3.0.3"
17+
const AgentVersion = "3.0.5"
1818

1919
// CustomCheck are external plugins and scripts which should be executed by the Agent
2020
type CustomCheck struct {

0 commit comments

Comments
 (0)