2000-04-26 09:28:03 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2003-01-31 09:47:16 +03:00
|
|
|
# $NetBSD: postfix,v 1.7 2003/01/31 06:47:16 lukem 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
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
2000-04-30 16:21:00 +04:00
|
|
|
name="postfix"
|
2000-09-19 17:04:38 +04:00
|
|
|
rcvar=$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"
|
2003-01-31 09:47:16 +03:00
|
|
|
start_cmd="${name} "'${rc_arg}'
|
|
|
|
stop_cmd=$start_cmd
|
|
|
|
reload_cmd=$start_cmd
|
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
|
|
|
|
2000-05-13 12:45:06 +04:00
|
|
|
load_rc_config $name
|
2000-04-30 16:21:00 +04:00
|
|
|
run_rc_command "$1"
|