#!/bin/sh
# $Id: monkeysphere.install 264 2010-11-10 00:57:53Z shtrom $
# vim:set ts=2 sw=2 et:

# arg 1:  the new package version
post_install() {
  echo ">>> Creating monkeysphere user and group and setting permissions..."
    getent group monkeysphere >/dev/null || groupadd -r monkeysphere
    getent passwd monkeysphere >/dev/null ||useradd -r -c 'Monkeysphere WoT server identification tool' -g monkeysphere -d '/var/lib/monkeysphere' -s /bin/bash monkeysphere
	echo ">>> Trying all available transitions..."
    for trans in 0.23 0.28 ; do
        /usr/share/monkeysphere/transitions/$trans || { \
            RET=$?
            echo "Failed running transition script /usr/share/monkeysphere/transitions/$trans" >&2
            exit $RET
        }
    done

}

pre_remove() {
  echo ">>> /var/lib/monkeysphere files and folder will be left in place,
    remove any reference to them from openssh-server config file to avoid being locked outside"
 }
