ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Sergey Plyukhin <sergey@sergey.iks.ru>
To: Sisyphus List <sisyphus@altlinux.ru>
Subject: Re: [sisyphus] Новый инитскрипт для pptp-client
Date: Sun, 1 Jun 2003 15:00:09 +1300
Message-ID: <20030601020009.GA29653@sergey.iks.ru> (raw)
In-Reply-To: <20030531105231.GA7565@home-pool4-116.com2com.ru>

On 14:52 Sat 31 May     , Yura Zotov wrote:
> > > 3. теперь этот скрипт НЕ устанавливает HOSTNAME, так что если, вам
> > >    нужно менять имя машины после старта туннеля, делайте это из
> > >    /etc/ppp/ip-up.local
> > опять получается "слишком глобальное" изменение для dial-up
> > >
> 
> Лично я пользуюсь и диалапом, и PPTP совершенно свободно и
> независимо, поэтому никаких проблем не вижу. Вероятно, надо
> просто похитрее написать скрипты ip-up.*
> 
> Я делаю так:
> 
> /etc/ppp/peers/tunnel_name:
> ...
> ipparam "tunnel_name"
> ...
получается "ссылка сам на себя"
нужное слово уже есть в имени файла
> 
> ============/etc/ppp/ip-up.local=======================
> #!/bin/sh
> 
> SCRIPT=/etc/ppp/ip-down.$6
здесь не опечатка?
> 
> [ -x $SCRIPT ] && $SCRIPT $@
> 
> всё, в этом файле больше ничего нету.
> 
> ============/etc/ppp/ip-up.tunnel_name==================
> #!/bin/bash
> 
> interface_name=$1
> local_IP_address=$3 
> remote_IP_address=$4
> ipparam=$5
> 
> #echo -e "$interface_name\n$tty_name\n$speed\n$local_IP_address\n$remote_IP_address\n$ipparam"> /ip-up.pptp.out
> 
> emails_file=/etc/ppp/email.list
> MAX_RETRIES=10
> 
> restart_service()
> {
> 	/sbin/service $1 restart &> /dev/null
а не получится тут разрыв связи модемом?
> }
> 
> ip2mail()
> {
> 	for mail_address in `cat $emails_file`
> 	do
> 		echo -e "Name: $HOSTNAME\nIP: $local_IP_address" | mail -s "New IP" "$mail_address"
> 	done
> }
> 
> i=0
> while [ $i -le $MAX_RETRIES ]
> do
> 	i=$((i+1))
> 	HOSTNAME=`host $local_IP_address | awk '/domain name pointer/ { sub(/\.$/, ""); print $5 }'`
> 	if [ "x$HOSTNAME" != "x" ]; then
> 		hostname $HOSTNAME
> 		initlog -s "Hostname set to $HOSTNAME" -n "ip-up.pptp"
> 		restart_service ntpd
> 		restart_service postfix
> 		ip2mail
> 		exit 0
> 	else
> 		ERROR_MSG="Hostname lookup failed "
> 		mail -s "ip-up.pptp: $ERROR_MSG" root@localhost
> 		sleep 2
> 	fi
> done
> 
> Соответственно, в ip-up.tunnl_name можно и route делать и всё,
> что хочешь. А все остальные соединения остаются как есть, так как
> в /etc/ppp/ip-up.local идёт выбор скрипта по ipparam.
в примере как-то "обще" и нет ничего об удалении маршрутов 
после опускания туннеля. Но это, конечно, поправимо :-)
> Единственное что нужно делать -- это использовать ipparam. 
> 
> Т.о. получается, что PPTP-туннель легко делается независимым и не
> влияющим на остальные PPP-соединения.
именно этого и надо :-)
> 
> Ваши замечания?
получается "новый" /etc/ppp/ip-up.tunnel_name  "почти калька" с 
существующего /etc/ppp/peers/__default. Может просто в этот файл и
добавить необходимые изменения?
Или существует какая-то иная причина и необходимо отказаться именно от
/etc/ppp/peers ?

В принципе все-равно откуда ставить маршруты из /etc/ppp/peers/__default
или /etc/ppp/ip-up.tunnel_name :-)
Это не первая и не последняя "переделка"
В любом случае спасибо за разьяснения.

> 
> По вопросам какие параметры передаются скриптам и в каком порядке
> man pppd.
> --
> Юрий А. Зотов



  reply	other threads:[~2003-06-01  2:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-30 11:30 Yura Zotov
2003-05-31  0:14 ` Sergey Plyukhin
2003-05-31 10:52   ` Yura Zotov
2003-06-01  2:00     ` Sergey Plyukhin [this message]
2003-06-01  6:31       ` Yura Zotov

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=20030601020009.GA29653@sergey.iks.ru \
    --to=sergey@sergey.iks.ru \
    --cc=sisyphus@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 Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/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 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git