* [mdk-re] relayhost patch
@ 2001-04-20 10:28 Mikhail Zabaluev
2001-04-20 11:51 ` cornet
0 siblings, 1 reply; 2+ messages in thread
From: Mikhail Zabaluev @ 2001-04-20 10:28 UTC (permalink / raw)
To: mandrake-russian
[-- Attachment #1: Type: text/plain, Size: 588 bytes --]
Доброе время суток.
По многочисленным просьбам трудящихся высылаю патч к
/etc/sysconfig/network-scripts/ifup-post
Модификация позволяет вводить в скрипты
/etc/sysconfig/network-scripts/ifcfg-* переменную SMTP_RELAYHOST,
согласно значению которой будет выставляться параметр relayhost в
/etc/postfix/main.cf
Заодно устранил пару заусенец в этом скрипте. Кстати, при некоторых
условиях up/down скрипты множат строки в /etc/resolv.conf - каждый
раз комментируют старые и добавляют новые невзирая на адреса.
--
Stay tuned,
MhZ JID: mookid@jabber.org
[-- Attachment #2: initscripts-5.49-relayhost.patch --]
[-- Type: text/plain, Size: 1065 bytes --]
--- ifup-post.orig Wed Mar 21 12:54:36 2001
+++ ifup-post Fri Apr 20 01:35:29 2001
@@ -32,7 +32,8 @@
[ "$?" = 0 ] && set_hostname $HOSTNAME
fi
-if [ "$PEERDNS" != no -o -n "$RESOLV_MODS" -a "$RESOLV_MODS" != no ]; then
+if [ -n "$PEERDNS" -a "$PEERDNS" != no -o \
+ -n "$RESOLV_MODS" -a "$RESOLV_MODS" != no ]; then
[ -n "$MS_DNS1" ] && DNS1=$MS_DNS1
[ -n "$MS_DNS2" ] && DNS2=$MS_DNS2
if [ -n "$DNS1" ] && ! grep -qs "^nameserver $DNS1" /etc/resolv.conf &&
@@ -93,7 +94,22 @@
# Notify programs that have requested notification
do_netreport
-IFDOWN_LOCAL=/sbin/ifup-local
+POSTFIX=/usr/sbin/postfix
+if [ -n "$SMTP_RELAYHOST" -a -x "$POSTFIX" ] && tr=`mktemp /tmp/postfix.XXXXXX`
+then
+ grep -v ^relayhost /etc/postfix/main.cf >$tr
+ echo "relayhost = $SMTP_RELAYHOST" >>$tr
+
+ # backup main.cf
+ cp -af /etc/postfix/main.cf /etc/postfix/main.cf.save
+
+ cat $tr > /etc/postfix/main.cf
+ rm -f $tr
+
+ "$POSTFIX" reload
+fi
+
+IFUP_LOCAL=/sbin/ifup-local
if [ -x "$IFUP_LOCAL" ]; then
"$IFUP_LOCAL" "$DEVICE"
fi
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [mdk-re] relayhost patch
2001-04-20 10:28 [mdk-re] relayhost patch Mikhail Zabaluev
@ 2001-04-20 11:51 ` cornet
0 siblings, 0 replies; 2+ messages in thread
From: cornet @ 2001-04-20 11:51 UTC (permalink / raw)
To: mandrake-russian
Mikhail Zabaluev wrote:
>
> Доброе время суток.
>
> По многочисленным просьбам трудящихся высылаю патч к
> /etc/sysconfig/network-scripts/ifup-post
> Модификация позволяет вводить в скрипты
> /etc/sysconfig/network-scripts/ifcfg-* переменную SMTP_RELAYHOST,
> согласно значению которой будет выставляться параметр relayhost в
> /etc/postfix/main.cf
>
> Заодно устранил пару заусенец в этом скрипте. Кстати, при некоторых
> условиях up/down скрипты множат строки в /etc/resolv.conf - каждый
> раз комментируют старые и добавляют новые невзирая на адреса.
Спасибо :-) У меня была аналогичная проблемма с /etc/resolv.host, решил
просто, в цепочку выполнения down вставил скриптик который просто
восстанавливал resolv.host из резервной копии, сделанной заранее
ручками.
--
******** FIRE & STEEL ********
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-04-20 11:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-20 10:28 [mdk-re] relayhost patch Mikhail Zabaluev
2001-04-20 11:51 ` cornet
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git