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