2000-04-26 09:28:03 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-08-13 22:08:03 +04:00
|
|
|
# $NetBSD: postfix,v 1.9 2004/08/13 18:08:03 mycroft Exp $
|
2000-04-26 09:28:03 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: mail
|
|
|
|
# REQUIRE: LOGIN
|
2002-02-12 05:19:27 +03:00
|
|
|
# we make mail start late, so that things like .forward's are not
|
|
|
|
# processed until the system is fully operational
|
2000-04-26 09:28:03 +04:00
|
|
|
|
2004-08-13 22:08:03 +04:00
|
|
|
$_rc_subr_loaded . /etc/rc.subr
|
2000-04-26 09:28:03 +04:00
|
|
|
|
2000-04-30 16:21:00 +04:00
|
|
|
name="postfix"
|
2000-09-19 17:04:38 +04:00
|
|
|
rcvar=$name
|
2004-04-08 10:15:27 +04:00
|
|
|
postfix_command="/usr/sbin/${name}"
|
2000-04-30 16:21:00 +04:00
|
|
|
required_files="/etc/${name}/main.cf"
|
2002-02-12 05:19:27 +03:00
|
|
|
start_precmd="postfix_precmd"
|
2004-04-08 10:15:27 +04:00
|
|
|
start_cmd="postfix_op"
|
|
|
|
stop_cmd="postfix_op"
|
|
|
|
reload_cmd="postfix_op"
|
2000-09-19 17:04:38 +04:00
|
|
|
extra_commands="reload"
|
2002-02-12 05:19:27 +03:00
|
|
|
spooletcdir="/var/spool/${name}/etc"
|
|
|
|
required_dirs=$spooletcdir
|
|
|
|
|
|
|
|
postfix_precmd()
|
|
|
|
{
|
|
|
|
# As this is called after the is_running and required_dir checks
|
|
|
|
# are made in run_rc_command(), we can safely assume ${spooletcdir}
|
|
|
|
# exists and postfix isn't running at this point (unless forcestart
|
|
|
|
# is used).
|
|
|
|
#
|
|
|
|
|
|
|
|
for f in localtime resolv.conf services; do
|
|
|
|
if [ -f /etc/$f ]; then
|
|
|
|
cmp -s /etc/$f ${spooletcdir}/$f || \
|
|
|
|
cp -p /etc/$f ${spooletcdir}/$f
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
2000-04-26 09:28:03 +04:00
|
|
|
|
2004-04-08 10:15:27 +04:00
|
|
|
postfix_op()
|
|
|
|
{
|
|
|
|
${postfix_command} ${rc_arg}
|
|
|
|
}
|
|
|
|
|
2000-05-13 12:45:06 +04:00
|
|
|
load_rc_config $name
|
2000-04-30 16:21:00 +04:00
|
|
|
run_rc_command "$1"
|