#!/bin/sh

pkg_postinst () {
	local crypt=$(grep "^root:" etc/shadow | cut -f 2 -d :)
	crypt=${crypt//\\/\\\\}
	crypt=${crypt//\//\\\/}
	sed -i "s/root:XXX/root:${crypt}/" etc/usermin/miniserv.users
}

pkg_postinst

echo ""
echo "To use the usermin program you must first start the"
echo "usermin mini-webserver by running 'usermin start' (as root)"
echo ""
echo "Then, point your web browser to:"
echo "http://localhost:${port}"
echo ""
echo "Typing 'usermin help' will repeat this message."
sleep 5
