X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=packaging%2Ffreebsd%2Fpkg-install;h=731667c262afe2ba726fcbb3dc6119750fcc34f7;hb=7b8af9a915f776e436d8d7bb97d64d9979793220;hp=940b7963eee074937e91fc6734e09bc35f457ddc;hpb=b5e33d44a4a838b8212a156b28b186331e5e4adb;p=monkeysphere.git diff --git a/packaging/freebsd/pkg-install b/packaging/freebsd/pkg-install index 940b796..731667c 100755 --- a/packaging/freebsd/pkg-install +++ b/packaging/freebsd/pkg-install @@ -15,6 +15,7 @@ # MySQL puts its data in /var/db/mysql VARLIB="/var/monkeysphere" +ETCDIR="/usr/local/etc/monkeysphere" case $2 in POST-INSTALL) @@ -24,7 +25,7 @@ POST-INSTALL) GID=${UID} SHELL=/usr/local/bin/bash - if pw group show "${GROUP}" 2>/dev/null; then + if pw group show "${GROUP}" >/dev/null 2>&1; then echo "You already have a group \"${GROUP}\", so I will use it." else if pw groupadd ${GROUP} -g ${GID}; then @@ -35,7 +36,8 @@ POST-INSTALL) fi fi - if oldshell=`pw user show "${USER}" 2>/dev/null`; then + if pw user show "${USER}" >/dev/null 2>&1; then + oldshell=`pw user show "${USER}" 2>/dev/null | cut -f10 -d:` 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'." @@ -55,20 +57,16 @@ POST-INSTALL) fi fi - ## set up the cache directories: + ## set up the cache directories, and link them to the config files: install -d -o root -g monkeysphere -m 750 "$VARLIB"/gnupg-host - cat < "$VARLIB"/gnupg-host/gpg.conf -list-options show-uid-validity -EOF + ln -sf "$ETCDIR"/gnupg-host.conf "$VARLIB"/gnupg-host/gpg.conf 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 -primary-keyring $VARLIB/gnupg-authentication/pubring.gpg -keyring $VARLIB/gnupg-host/pubring.gpg -EOF + ln -sf "$ETCDIR"/gnupg-authentication.conf "$VARLIB"/gnupg-authentication/gpg.conf + + install -d "$VARLIB"/tmp "$VARLIB"/authorized_keys + chown monkeysphere:monkeysphere "$VARLIB"/gnupg-authentication/gpg.conf monkeysphere-server diagnostics