3 # an installation script for monkeysphere (borrowing liberally from
4 # postgresql and mysql pkg-install scripts, and from monkeysphere's
5 # debian/monkeysphere.postinst)
7 # Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 # FIXME: is /var/lib/monkeysphere the right place for this stuff on
13 # PostgreSQL puts its data in /usr/local/pgsql/data
15 # MySQL puts its data in /var/db/mysql
17 VARLIB="/var/monkeysphere"
26 if pw group show "${GROUP}" 2>/dev/null; then
27 echo "You already have a group \"${GROUP}\", so I will use it."
29 if pw groupadd ${GROUP} -g ${GID}; then
30 echo "Added group \"${GROUP}\"."
32 echo "Adding group \"${GROUP}\" failed..."
37 if pw user show "${USER}" 2>/dev/null; then
38 echo "You already have a user \"${USER}\", so I will use it."
40 if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
41 -d "$VARLIB" -s /bin/sh -c "monkeysphere authentication user,,,"
43 echo "Added user \"${USER}\"."
45 echo "Adding user \"${USER}\" failed..."
50 ## set up the cache directories:
52 install -d -o root -g monkeysphere -m 750 "$VARLIB"/gnupg-host
53 cat <<EOF > "$VARLIB"/gnupg-host/gpg.conf
54 list-options show-uid-validity
57 install -d -o monkeysphere -g monkeysphere -m 700 "$VARLIB"/gnupg-authentication
58 # install authentication gpg.conf
59 cat <<EOF > "$VARLIB"/gnupg-authentication/gpg.conf
60 list-options show-uid-validity
61 primary-keyring $VARLIB/gnupg-authentication/pubring.gpg
62 keyring $VARLIB/gnupg-host/pubring.gpg
64 chown monkeysphere:monkeysphere "$VARLIB"/gnupg-authentication/gpg.conf