Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > af2c25f3e34c1a82f8610b3264d456c7 > scriptlet

mercurial-server-0.6-1mdv2010.0.noarch.rpm

PREIN

/bin/sh
# Need to run usermod -U twice to unlock created account:
if ! getent passwd hg 2>&1 > /dev/null; then \
   /usr/sbin/useradd -r -m -d /var/hg -s /bin/bash -c "Mercurial repository server user" hg && \
   /usr/sbin/usermod -U hg && /usr/sbin/usermod -U hg 
fi

POSTIN

/bin/sh
[ -d /var/hg ] && [ ! -d /var/hg/repos ] && \
chown -R hg:hg /var/hg && \
/bin/su hg -c "/usr/share/mercurial-server/init/hginit /usr/share/mercurial-server"

cat <<EOF
-------------------------------------------------------------------------------
Place the SSH public key(s) of the user(s) who require access to the repository
in the directory /etc/mercurial-server/keys/root and run 
/usr/share/mercurial-server/refresh-auth while logged in as the user hg.
-------------------------------------------------------------------------------
EOF

POSTUN

/bin/sh
/usr/sbin/userdel -r hg