Package: mailman-cn
Architecture: all
-Depends: mailman (>= 1:2.1.11), apache2-cn, carnet-tools-cn (>= 2.4)
+Depends: mailman (>= 1:2.1.11), apache2-cn, carnet-tools-cn (>= 2.4), ucf
Pre-Depends: pwgen
Description: Powerful, web-based mailing list manager
The GNU Mailing List Manager, which manages email discussion lists
ln -sf /etc/mailman/apache.conf /etc/apache2/conf.d/mailman-cn.conf
fi
-HOSTNAME="`hostname --fqdn`"
+hostname="`hostname --fqdn`"
mmcfg_add () {
opt="$1"
# ocisti smece od prosle verzije
if dpkg --compare-versions "$2" lt 2:2.1.5-9; then
- HN="'$HOSTNAME'"
+ HN="'$hostname'"
grep -v -E 'DEFAULT_(URL_PATTERN|URL_HOST|EMAIL_HOST) =' $MM_CFG | \
awk '/^# Default host for web interface of newly created MLs/ { print $0; print "DEFAULT_EMAIL_HOST = '$HN'"; getline } { print $0 }' | \
awk '/^# Default domain for email addresses of newly created MLs/ { print $0; print "DEFAULT_URL_HOST = '$HN'"; getline } { print $0 }' \
mmcfg_add "VIRTUAL_HOST_OVERVIEW" "Off"
# sredi DEFAULT_URL_HOST
-mmcfg_add "DEFAULT_URL_HOST" "'$HOSTNAME'"
+mmcfg_add "DEFAULT_URL_HOST" "'$hostname'"
# sredi DEFAULT_EMAIL_HOST
-mmcfg_add "DEFAULT_EMAIL_HOST" "'$HOSTNAME'"
+mmcfg_add "DEFAULT_EMAIL_HOST" "'$hostname'"
# sredi PRIVATE_ARCHIVE_URL
mmcfg_add "PRIVATE_ARCHIVE_URL" "'/mailman/private'"
# kreirati mailman listu
if [ -z "`list_lists | grep -i mailman`" ]; then
- newlist -q mailman mailman@$HOSTNAME `pwgen 8 1` > /dev/null
+ newlist -q mailman mailman@$hostname `pwgen 8 1` > /dev/null
fi
# kreirati aliase
# dodati roota na mailman listu:
if [ ! "`list_members mailman | wc -l`" -ge 1 ]; then
add_members -r - mailman <<EOF
-root@$HOSTNAME
+root@$hostname
EOF
fi
db_stop || true
# restart mailman
-if [ "$restart" = "yes" -a -x /etc/init.d/mailman ]; then
- /etc/init.d/mailman stop
- /etc/init.d/mailman start
+if [ "$restart" = "yes" -a -x /etc/init.d/mailman -a -x /usr/sbin/invoke-rc.d]; then
+ invoke-rc.d mailman stop
+ invoke-rc.d mailman start
fi
-# restartat apache2
-if [ -x /etc/init.d/apache2 ]; then
- /etc/init.d/apache2 reload || true
+# reload apache2
+if [ -x /usr/sbin/invoke-rc.d ]; then
+ [ -x /etc/init.d/apache2 ] && invoke-rc.d apache2 reload
+else
+ [ -x /etc/init.d/apache2 ] && /etc/init.d/apache2 reload
fi
# promjena passworda
echo "CN: # mmsitepass"
echo "CN:"
fi
-echo "CN: Web interface is at http://$HOSTNAME/mailman/admin/"
+echo "CN: Web interface is at http://$hostname/mailman/admin/"
rm -f /etc/apache2/conf.d/mailman-cn.conf
fi
-# restartat apache
-if [ -x /etc/init.d/apache2 ]; then
- /etc/init.d/apache2 reload || true
+# reload apache2
+if [ -x /usr/sbin/invoke-rc.d ]; then
+ [ -x /etc/init.d/apache2 ] && invoke-rc.d apache2 reload
+else
+ [ -x /etc/init.d/apache2 ] && /etc/init.d/apache2 reload
fi