summaryrefslogtreecommitdiff
path: root/sysutils/ups-nut/INSTALL
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/ups-nut/INSTALL')
-rw-r--r--sysutils/ups-nut/INSTALL44
1 files changed, 44 insertions, 0 deletions
diff --git a/sysutils/ups-nut/INSTALL b/sysutils/ups-nut/INSTALL
new file mode 100644
index 00000000000..d2b1a1937ce
--- /dev/null
+++ b/sysutils/ups-nut/INSTALL
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $NetBSD: INSTALL,v 1.1 2001/10/31 22:54:04 zuntum Exp $
+
+USER=@NUT_USER@
+GROUP=@NUT_GROUP@
+
+ADDUSER="@ADDUSER@"
+ADDGROUP="@ADDGROUP@"
+CHGRP="@CHGRP@"
+ID="@ID@"
+RM="@RM@"
+TOUCH="@TOUCH@"
+
+# Group... the default's shipped with NetBSD
+# We need to check that ${GROUP} exists before adding the user.
+# Do it with chgrp to be able to use NIS.
+#
+${TOUCH} "/tmp/grouptest.$$"
+${CHGRP} ${GROUP} "/tmp/grouptest.$$" >/dev/null 2>&1
+if [ $? -eq 0 ]
+then
+ echo "Group '${GROUP}' already exists...proceeding."
+else
+ echo "Creating '${GROUP}' group..."
+ ${ADDGROUP} ${GROUP}
+ echo "Done."
+fi
+${RM} -f "/tmp/grouptest.$$"
+
+# Use `id' to be able to use NIS.
+#
+${ID} ${USER} 2>/dev/null >/dev/null
+if [ $? -eq 0 ]
+then
+ echo "User '${USER}' already exists...proceeding."
+else
+ echo "Creating '${USER}' user..."
+ ${ADDUSER} \
+ -c "Network UPS Tools" \
+ -g ${GROUP} -s /bin/sh -m ${USER}
+ echo "Done."
+fi
+exit 0