Нет. Эти скрипты запускает сам pppd при установке и разрыве соединения соответственно.
У меня из ip-up запускаются сервисы вроде DynDNS и ntp. Через ip-down останавливаются.
Вы наличие интернета проверяете через ifconfig, а я в ip-up создаю файл с текущим ip, в ip-down удаляю его. Соответственно, наличие соединения проверяется по наличию файла.
ip-up:Код
#!/bin/sh
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
# $5 the remote IP address
# $6 the parameter specified by the 'ipparam' option to pppd
# Variables:
# 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.
IFACE=$1
LOCAL_IP=$4
if [ "$IFACE" = "ppp0" ]; then
echo $LOCAL_IP > /var/ppp/ip
/etc/init.d/dyndns start
/etc/init.d/ntp sync
fi
ip-down:Код
#!/bin/sh
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
# $5 the remote IP address
# $6 the parameter specified by the 'ipparam' option to pppd
# Variables:
# CONNECT_TIME The number of seconds from when the PPP negotiation started until the connection was terminated.
# BYTES_SENT The number of bytes sent (at the level of the serial port) during the connection.
# BYTES_RCVD 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.
# CALL_FILE The value of the call 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.
IFACE=$1
if [ "$IFACE" = "ppp0" ]; then
rm /var/ppp/ip
/etc/init.d/dyndns stop
fi
Скрипты описаны в man pppd