а ежли не секрет, зачем эти извращения?
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
USER=`who|grep "$1\ "|awk '{print $1}'`
man pppd писал(а):SCRIPTS
Pppd invokes scripts at various stages in its processing which can be used to perform site-specific
ancillary processing. These scripts are usually shell scripts, but could be executable code files
instead. Pppd does not wait for the scripts to finish (except for the ip-pre-up script). The
scripts are executed as root (with the real and effective user-id set to 0), so that they can do
things such as update routing tables or run privileged daemons. Be careful that the contents of
these scripts do not compromise your system's security. Pppd runs the scripts with standard input,
output and error redirected to /dev/null, and with an environment that is empty except for some
environment variables that give information about the link. The environment variables that pppd
sets are:
DEVICE The name of the serial tty device being used.
IFNAME The name of the network interface being used.
IPLOCAL
The IP address for the local end of the link. This is only set when IPCP has come up.
IPREMOTE
The IP address for the remote end of the link. This is only set when IPCP has come up.
PEERNAME
The authenticated name of the peer. This is only set if the peer authenticates itself.
SPEED The baud rate of the tty device.
ORIG_UID
The real user-id of the user who invoked pppd.
PPPLOGNAME
The username of the real user-id that invoked pppd. This is always set.
For the ip-down and auth-down scripts, pppd also sets the following variables giving statistics for
the connection:
CONNECT_TIME
The number of seconds from when the PPP negotiation started until the connection was termi‐
nated.
BYTES_SENT
The number of bytes sent (at the level of the serial port) during the connection.
The number of bytes received (at the level of the serial port) during the connection.
LINKNAME
The logical name of the link, set with the linkname option.
DNS1 If the peer supplies DNS server addresses, this variable is set to the first DNS server
address supplied.
DNS2 If the peer supplies DNS server addresses, this variable is set to the second DNS server
address supplied.
не говоря уже о том, что такие вещи лучше делать не из /etc/ppp/ip-up.d/.... а из
/etc/ppp/ip-pre-up. Разница в том, что pppd вызывает ip-pre-up когда пройдена аутентификация, на ифейс назначен адрес, но сам ифейс
ещё не поднят и пппд
ждёт завершения этого скрипта. А скрипты из /etc/ppp/ip-up.d/ pppd вызывает, когда ифейс
уже поднят и они выполняются асинхронно-параллельно с pppd (pppd
не ждёт их завершения)
а ваще всё решается статической адресацией безо всяких извращений
ЗЫ: а на форуме уже 20 мая
Любой тупик - это тщательно замаскированный выход.