summaryrefslogtreecommitdiff
path: root/nonprism/bitlbee-libre-nonprism/bitlbee.install
diff options
context:
space:
mode:
Diffstat (limited to 'nonprism/bitlbee-libre-nonprism/bitlbee.install')
-rw-r--r--nonprism/bitlbee-libre-nonprism/bitlbee.install21
1 files changed, 14 insertions, 7 deletions
diff --git a/nonprism/bitlbee-libre-nonprism/bitlbee.install b/nonprism/bitlbee-libre-nonprism/bitlbee.install
index aa5a81a70..c8a8f93a1 100644
--- a/nonprism/bitlbee-libre-nonprism/bitlbee.install
+++ b/nonprism/bitlbee-libre-nonprism/bitlbee.install
@@ -1,15 +1,22 @@
post_install() {
- getent group bitlbee &>/dev/null || groupadd -r -g 65 bitlbee >/dev/null
- getent passwd bitlbee &>/dev/null || useradd -r -u 65 -g bitlbee -d /var/lib/bitlbee -s /bin/false -c bitlbee bitlbee >/dev/null
- systemd-tmpfiles --create bitlbee.conf
+ if ! getent group bitlbee &>/dev/null; then
+ groupadd -r -g 65 bitlbee >/dev/null
+ fi
+ if ! getent passwd bitlbee &>/dev/null; then
+ useradd -r -u 65 -g bitlbee -d /var/lib/bitlbee -s /bin/false -c bitlbee bitlbee >/dev/null
+ fi
+ systemd-tmpfiles --create bitlbee.conf
}
post_upgrade() {
- post_install
+ post_install
}
post_remove() {
- getent passwd bitlbee &>/dev/null && userdel bitlbee >/dev/null
- getent group bitlbee &>/dev/null && groupdel bitlbee >/dev/null
- true
+ if getent passwd bitlbee &>/dev/null; then
+ userdel bitlbee >/dev/null
+ fi
+ if getent group bitlbee &>/dev/null; then
+ groupdel bitlbee >/dev/null
+ fi
}