aboutsummaryrefslogtreecommitdiffstats
path: root/security/sfs/pkg-install
diff options
context:
space:
mode:
authorpetef <petef@FreeBSD.org>2003-01-02 13:23:45 +0800
committerpetef <petef@FreeBSD.org>2003-01-02 13:23:45 +0800
commitac035ed59d992c7d7dedaf3b8217ced20a473f0b (patch)
treeaa45742d6cb0a0f8020d1d25577131cbbe09997c /security/sfs/pkg-install
parent248eee7ba80042c728a0700821e417b87f99b617 (diff)
downloadfreebsd-ports-gnome-ac035ed59d992c7d7dedaf3b8217ced20a473f0b.tar.gz
freebsd-ports-gnome-ac035ed59d992c7d7dedaf3b8217ced20a473f0b.tar.zst
freebsd-ports-gnome-ac035ed59d992c7d7dedaf3b8217ced20a473f0b.zip
Update to 0.7.2.
PR: 46148 Submitted by: maintainer
Diffstat (limited to 'security/sfs/pkg-install')
-rw-r--r--security/sfs/pkg-install116
1 files changed, 58 insertions, 58 deletions
diff --git a/security/sfs/pkg-install b/security/sfs/pkg-install
index 631e08839f20..55a4cf6bc94a 100644
--- a/security/sfs/pkg-install
+++ b/security/sfs/pkg-install
@@ -4,10 +4,6 @@ if [ -n "${PACKAGE_BUILDING}" ]; then
exit 0
fi
-if [ "$2" != "POST-INSTALL" ]; then
- exit 0
-fi
-
KEYFILE="$PKG_PREFIX/etc/sfs/sfs_host_key"
USER=sfs
@@ -18,75 +14,79 @@ PW=/usr/sbin/pw
SFSDIR=/var/spool/sfs
-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."
+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 "FAILED!"
- exit 1
+ echo "exists."
fi
-else
- echo "exists."
-fi
-echo -n "Checking for user '$USER'... "
+ 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 'Self-Certifying File System' -d /nonexistent -g $GROUP -s /sbin/nologin -h -; then
- echo "success."
+ if ! ${PW} usershow $USER >/dev/null 2>&1; then
+ echo -n "doesn't exist, adding... "
+ if ${PW} useradd $USER -u ${UID} -c 'Self-Certifying File System' -d /nonexistent -g $GROUP -s /sbin/nologin -h -; then
+ echo "success."
+ else
+ echo "FAILED!"
+ exit 1
+ fi
else
- echo "FAILED!"
- exit 1
+ echo "exists."
fi
-else
- echo "exists."
fi
-echo -n "Checking for SFS directory ($SFSDIR)... "
+if [ "$2" = "POST-INSTALL" ]; then
+ echo -n "Checking for SFS directory ($SFSDIR)... "
-if [ -d "$SFSDIR" ]; then
- echo "already exists."
-else
- echo -n "creating... "
- if mkdir $SFSDIR; then
- echo "success."
+ if [ -d "$SFSDIR" ]; then
+ echo "already exists."
else
- echo "FAILED!"
+ echo -n "creating... "
+ if mkdir $SFSDIR; then
+ echo "success."
+ else
+ echo "FAILED!"
+ exit 1
+ fi
+ fi
+
+ if ! chmod 750 $SFSDIR; then
+ echo "chmod 750 $SFSDIR FAILED!"
exit 1
fi
-fi
-if ! chmod 750 $SFSDIR; then
- echo "chmod 750 $SFSDIR FAILED!"
- exit 1
-fi
+ if ! chown $USER:$GROUP $SFSDIR; then
+ echo "chown $USER:$GROUP $SFSDIR FAILED!"
+ exit 1
+ fi
-if ! chown $USER:$GROUP $SFSDIR; then
- echo "chown $USER:$GROUP $SFSDIR FAILED!"
- exit 1
-fi
+ echo -n "Checking for SFS host key ($KEYFILE)... "
-echo -n "Checking for SFS host key ($KEYFILE)... "
-
-if [ -f "$KEYFILE" ]; then
- echo "already exists, not generating."
-else
- echo "doesn't exist, generating."
- echo "Starting sfscd for entropy services."
- $PKG_PREFIX/sbin/sfscd
- echo -n "Sleeping ten seconds to give sfscd time to start up... "
- sleep 10
- echo "done."
- $PKG_PREFIX/bin/sfskey gen -KP -n `uname -n` $KEYFILE
- echo -n "Key generation done, killing sfscd... "
- kill -TERM `cat /var/run/sfscd.pid`
- echo "done."
-fi
+ if [ -f "$KEYFILE" ]; then
+ echo "already exists, not generating."
+ else
+ echo "doesn't exist, generating."
+ echo "Starting sfscd for entropy services."
+ $PKG_PREFIX/sbin/sfscd
+ echo -n "Sleeping ten seconds to give sfscd time to start up... "
+ sleep 10
+ echo "done."
+ $PKG_PREFIX/bin/sfskey gen -KP -l `uname -n` $KEYFILE
+ echo -n "Key generation done, killing sfscd... "
+ kill -TERM `cat /var/run/sfscd.pid`
+ echo "done."
+ fi
-cat $PKG_PREFIX/share/doc/sfs/WELCOME
+ cat $PKG_PREFIX/share/doc/sfs/WELCOME
+fi
exit 0