From: Mikhail Zabaluev <mhz@alt-linux.org> To: mandrake-russian@altlinux.ru Subject: [mdk-re] relayhost patch Date: Fri Apr 20 10:28:12 2001 Message-ID: <20010420014423.A1935@localhost.localdomain> (raw) [-- 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
next reply other threads:[~2001-04-20 10:28 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-04-20 10:28 Mikhail Zabaluev [this message] 2001-04-20 11:51 ` cornet
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20010420014423.A1935@localhost.localdomain \ --to=mhz@alt-linux.org \ --cc=mandrake-russian@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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