summarylogtreecommitdiffstats
path: root/rwhod.install
diff options
context:
space:
mode:
Diffstat (limited to 'rwhod.install')
-rw-r--r--rwhod.install32
1 files changed, 26 insertions, 6 deletions
diff --git a/rwhod.install b/rwhod.install
index 5e863eb832bc..3ee05942f75e 100644
--- a/rwhod.install
+++ b/rwhod.install
@@ -1,7 +1,27 @@
-post_install () {
- echo ">> Place 'rwhod' in DAEMONS= in /etc/rc.conf to enable rwhod on system boot."
+post_install() {
+ if ! getent group rwhod &>/dev/null; then
+ groupadd -r rwhod &>/dev/null
+ fi
+
+ if ! getent passwd rwhod &>/dev/null; then
+ useradd -s /bin/false -d /var/spool/rwho -g rwhod -M -r rwhod &>/dev/null
+ fi
+
+ chown -R rwhod:rwhod /var/spool/rwho
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ if getent passwd rwhod &>/dev/null; then
+ userdel rwhod &>/dev/null
+ fi
+
+ if getent group rwhod &>/dev/null; then
+ groupdel rwhod &>/dev/null
+ fi
+
+ rm -rf /var/spool/rwhod/* &>/dev/null || true
}
-op=$1
-shift
-$op $*
- \ No newline at end of file