#! /bin/sh -e

. /usr/share/debconf/confmodule

if [ "$(getent passwd | grep ^sashroot:)" = "" ]; then
    db_input medium sash/create_sashroot || true
    db_go || true
    db_get sash/create_sashroot || true
    if [ "$RET" = "true" ]; then
        db_input medium sash/clone_root_passwd || true
        db_go || true
        db_get sash/clone_root_passwd || true
        if [ "$RET" = "false" ]; then
            db_input critical sash/sashroot_passwd || true
            db_go || true
        fi
    else
        db_input low sash/change_root_shell || true
    fi
fi
db_go || true
