aboutsummaryrefslogtreecommitdiff
path: root/devel/sfslite/pkg-install
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2005-09-17 11:04:52 +0000
committerPav Lucistnik <pav@FreeBSD.org>2005-09-17 11:04:52 +0000
commitb1e421026014fb1ea1c2ecc7465b3b2ab6632ba7 (patch)
tree47f428d5310517cb15e367dc44fb03a49d6420e3 /devel/sfslite/pkg-install
parented72f750479caab07024fd1fbaff0488030177d9 (diff)
downloadports-b1e421026014fb1ea1c2ecc7465b3b2ab6632ba7.tar.gz
ports-b1e421026014fb1ea1c2ecc7465b3b2ab6632ba7.zip
Notes
Diffstat (limited to 'devel/sfslite/pkg-install')
-rw-r--r--devel/sfslite/pkg-install45
1 files changed, 45 insertions, 0 deletions
diff --git a/devel/sfslite/pkg-install b/devel/sfslite/pkg-install
new file mode 100644
index 000000000000..1de77adb48a5
--- /dev/null
+++ b/devel/sfslite/pkg-install
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+if [ -n "${PACKAGE_BUILDING}" ]; then
+ exit 0
+fi
+
+USER=sfs
+GROUP=sfs
+UID=171
+GID=171
+PW=/usr/sbin/pw
+COMMENT='Self-Certifying File System'
+
+if [ "$2" = "PRE-INSTALL" ]; then
+ echo -n "Checking for group '$GROUP'... "
+
+ if ! ${PW} groupshow $GROUP >/dev/null 2>&1; then
+ echo -n "doesn't exist, adding... "
+ if ${PW} groupadd $GROUP -g ${GID}; then
+ echo "success."
+ else
+ echo "FAILED!"
+ exit 1
+ fi
+ else
+ echo "exists."
+ fi
+
+ echo -n "Checking for user '$USER'... "
+
+ if ! ${PW} usershow $USER >/dev/null 2>&1; then
+ echo -n "doesn't exist, adding... "
+ if ${PW} useradd $USER -u ${UID} -c ${COMMENT} \
+ -d /nonexistent -g $GROUP -s /sbin/nologin -h -; then
+ echo "success."
+ else
+ echo "FAILED!"
+ exit 1
+ fi
+ else
+ echo "exists."
+ fi
+fi
+
+exit 0