X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=packaging%2Ffreebsd%2Fpkg-install;h=940b7963eee074937e91fc6734e09bc35f457ddc;hb=0e69638709367ccd337460adc4a50a76fce064fa;hp=dc75cf7b1ded009cc6b0859afc7cac0f13644d57;hpb=85b105c27fb67921199d282dc90d612c9b525bee;p=monkeysphere.git diff --git a/packaging/freebsd/pkg-install b/packaging/freebsd/pkg-install index dc75cf7..940b796 100755 --- a/packaging/freebsd/pkg-install +++ b/packaging/freebsd/pkg-install @@ -22,6 +22,7 @@ POST-INSTALL) GROUP=${USER} UID=641 GID=${UID} + SHELL=/usr/local/bin/bash if pw group show "${GROUP}" 2>/dev/null; then echo "You already have a group \"${GROUP}\", so I will use it." @@ -34,11 +35,18 @@ POST-INSTALL) fi fi - if pw user show "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." + if oldshell=`pw user show "${USER}" 2>/dev/null`; then + if [ x"$oldshell" != x"$SHELL" ]; then + echo "You already have a \"${USER}\" user, but its shell is '$oldshell'." + echo "This package requires that \"${USER}\"'s shell be '$SHELL'." + echo "You should fix this by hand and then re-install the package." + echo " hint: pw usermod '$USER' -s '$SHELL'" + exit 1 + fi + echo "You already have a user \"${USER}\" with the proper shell, so I will use it." else if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -d "$VARLIB" -s /sbin/sh -c "monkeysphere authentication user,,," + -d "$VARLIB" -s /usr/local/bin/bash -c "monkeysphere authentication user,,," then echo "Added user \"${USER}\"." else @@ -49,12 +57,12 @@ POST-INSTALL) ## set up the cache directories: - install --owner root --group monkeysphere --mode 750 -d "$VARLIB"/gnupg-host + install -d -o root -g monkeysphere -m 750 "$VARLIB"/gnupg-host cat < "$VARLIB"/gnupg-host/gpg.conf list-options show-uid-validity EOF - install --owner monkeysphere --group monkeysphere --mode 700 -d "$VARLIB"/gnupg-authentication + install -d -o monkeysphere -g monkeysphere -m 700 "$VARLIB"/gnupg-authentication # install authentication gpg.conf cat < "$VARLIB"/gnupg-authentication/gpg.conf list-options show-uid-validity @@ -63,5 +71,6 @@ keyring $VARLIB/gnupg-host/pubring.gpg EOF chown monkeysphere:monkeysphere "$VARLIB"/gnupg-authentication/gpg.conf + monkeysphere-server diagnostics ;; esac