diff options
Diffstat (limited to 'naemon.install')
-rw-r--r-- | naemon.install | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/naemon.install b/naemon.install new file mode 100644 index 0000000..429505a --- /dev/null +++ b/naemon.install | |||
@@ -0,0 +1,19 @@ | |||
1 | pre_install() { | ||
2 | getent group naemon &> /dev/null || groupadd -r naemon -g 44 | ||
3 | getent passwd naemon &> /dev/null || useradd -r -u 44 -g naemon \ | ||
4 | -d /var/lib/naemon -s /sbin/nologin -c "Naemon" naemon | ||
5 | } | ||
6 | |||
7 | pre_upgrade() { | ||
8 | pre_install | ||
9 | } | ||
10 | |||
11 | pre_remove() { | ||
12 | if [[ -f /run/naemon/naemon.pid ]]; then | ||
13 | systemctl stop naemon | ||
14 | fi | ||
15 | } | ||
16 | |||
17 | post_remove() { | ||
18 | userdel naemon | ||
19 | } | ||