File: munin-async.postinst

package info (click to toggle)
munin 2.0.63-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,008 kB
  • sloc: perl: 11,644; java: 1,924; sh: 1,619; makefile: 636; javascript: 365; python: 267
file content (31 lines) | stat: -rw-r--r-- 576 bytes parent folder | download | duplicates (3)
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
#! /bin/sh

set -e

prevver="$2"

add_munin_async_user() {
	if ! getent passwd munin-async >/dev/null; then
		adduser --group --system --home /var/lib/munin-async --shell /bin/bash munin-async
	fi
	# workaround bug (#531021) in xen-tools (user exists, but group is missing)
	if ! getent group munin-async >/dev/null; then
		addgroup --system munin-async
		adduser munin-async munin-async
	fi
}

initperms() {
	chown munin-async:munin-async /var/lib/munin-async
}

case "$1" in
	configure)
		add_munin_async_user
		if [ -z "$2" ]; then
			initperms
		fi
		;;
esac

#DEBHELPER#