emailrelay/debian/postinst
Graeme Walker 61ffec9a36 v1.8.1
2008-05-21 12:00:00 +00:00

38 lines
599 B
Bash

#!/bin/sh
#
# postinst
#
spool="/var/spool/emailrelay"
submit="/usr/sbin/emailrelay-submit"
create_spool()
{
test -d "$spool" || mkdir "$spool"
}
fix_permissions()
{
if ls -nd "$spool" | cut -d' ' --fields=3,4 | grep -q '^0 0$'
then
chgrp daemon "$spool" && chmod 775 "$spool"
fi
if ls -n "$submit" | cut -d' ' --fields=3,4 | grep -q '^0 0$'
then
chgrp daemon "$submit" && chmod g+s "$submit"
fi
}
fix_html()
{
# index.html refers to changelog.html
cd /usr/share/doc/emailrelay && gzip -d -c changelog.html.gz > changelog.html
}
#DEBHELPER#
create_spool
fix_permissions
fix_html