add checks to make sure that the test suite will be able to run.
[monkeysphere.git] / debian / monkeysphere.postinst
1 #!/bin/sh -e
2
3 # postinst script for monkeysphere
4
5 # Author: Jameson Rollins <jrollins@fifthhorseman.net>
6 # Copyright 2008
7
8 ETC="/etc/monkeysphere"
9 VARLIB="/var/lib/monkeysphere"
10
11 if ! getent passwd monkeysphere >/dev/null ; then
12     echo "adding monkeysphere user..."
13     adduser --quiet --system --no-create-home --group \
14         --home "$VARLIB" \
15         --shell '/bin/bash' \
16         --gecos 'monkeysphere authentication user,,,' \
17         monkeysphere
18 fi
19
20 # install host gnupg home directory
21 install --owner root --group monkeysphere --mode 750 -d "$VARLIB"/gnupg-host
22 # link in the gpg.conf
23 ln -sTf "$ETC"/gnupg-host.conf "$VARLIB"/gnupg-host/gpg.conf
24
25 # install authentication gnupg home directory
26 install --owner monkeysphere --group monkeysphere --mode 700 -d "$VARLIB"/gnupg-authentication
27 # link in the gpg.conf
28 ln -sTf "$ETC"/gnupg-authentication.conf "$VARLIB"/gnupg-authentication/gpg.conf