work on maintainer scripts:
[monkeysphere.git] / packaging / debian / monkeysphere.postinst
1 #!/bin/sh -e
2
3 # postinst script for monkeysphere
4
5 # Author: Jameson Rollins <jrollins@finestructure.net>
6 # Copyright 2008-2009
7
8 VARLIB="/var/lib/monkeysphere"
9
10 case $1 in
11     configure)
12         # add a monkeysphere user if one does not already exist
13         if ! getent passwd monkeysphere >/dev/null ; then
14             echo "adding monkeysphere user..."
15             adduser --quiet --system --no-create-home --group \
16                 --home "$VARLIB" \
17                 --shell '/bin/bash' \
18                 --gecos 'monkeysphere authentication user,,,' \
19                 monkeysphere
20         fi
21
22         # try to transition from to 0.23:
23         /usr/share/monkeysphere/transitions/0.23
24
25         # setup monkeysphere authentication
26         monkeysphere-authentication setup
27         ;;
28 esac
29
30 # dh_installdeb will replace this with shell code automatically
31 # generated by other debhelper scripts.
32
33 #DEBHELPER#
34
35 exit 0