[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [linux] ip-up ip-down
On Tue, Jun 05, 2001 at 08:41:54PM +0200, Pol wrote:
>
> Est ce que qqun peut me lister le contenu du son ip-up et ip-down svp ?
alors moi, j'ai plein de trucs dedans ;)
#!/bin/sh
# /etc/ppp/ip-up
PATH=/usr/bin:/usr/sbin:/usr/local/bin:/sbin:/bin
export PATH
if [ -s /var/log/messages ] && (ps xc 2>/dev/null | grep -q syslogd 2>/dev/null ); then
S=`tail -n 30 /var/log/messages 2>/dev/null | grep "CARRIER[^)]" 2>/dev/null | tr -d "^M" 2>/dev/null | cut -d: -f4 2>/dev/null`
echo -n "$S" >/dev/tty12
echo " Local: $4 -> Remote: $5 $1" >/dev/tty12
else
echo " Local: $4 -> Remote: $5 $1" >/dev/tty12
fi
sendmail -q 5
# Name parameters
INTERFACE="$1"
TTY_DEVICE="$2"
SPEED="$3"
LOCAL_IP="$4"
REMOTE_IP="$5"
PARAMS="$6"
# Used files
REPORT="/var/run/ppp-is-active"
REPORT_IP="/var/run/ppp-ip"
IP_LOG="/var/log/ip-local-remote"
TIMER="/var/log/ppp-report"
# Created files will have perm --rw-r--r--
umask 033
# Log connection
DATE=`date "+%s"`
HOUR=`date "+%w:%H:%M"`
echo "CONNECT $DATE $HOUR" >> "$TIMER"
# Create a ppp report
/bin/cat > "$REPORT" << EOF
interface: $INTERFACE
tty_device: $TTY_DEVICE
speed: $SPEED
local_ip: $LOCAL_IP
remote_ip: $REMOTE_IP
params: $PARAMS
EOF
echo "$LOCAL_IP" > "$REPORT_IP"
# Logs the local and remote ip
echo "$LOCAL_IP -> $REMOTE_IP" >> "$IP_LOG"
# Tells the proxy we are online
/usr/local/sbin/wwwoffled -c /var/spool/wwwoffle/wwwoffle.conf 1>&2 >/dev/null
/usr/local/bin/wwwoffle -online
# Uploads IP info on the server
/etc/ppp/upload-ip-info
# Uploads IP info for dyndns
ddup --host binny.dyndns.org >/dev/tty12
ddup --host plok.mine.nu >/dev/tty12
ddup --host iarl.mine.nu >/dev/tty12
ddup --host tetsuo.mine.nu >/dev/tty12
# EOF
et
#!/bin/sh
# /etc/ppp/ip-down
PATH=/usr/sbin:/sbin:/usr/bin:/usr/local/bin:/bin
export PATH
# EOF
>
> Je recois tjs 1 erreur de pppd quand il essaie de les executer.
>
> -pol-
>
>
---end quoted text---
@+,
binny
--
#ifdef FUNNY_MSGS
M_print ("No Mirabilis client was maimed, hacked, tortured,
sodomized otherwise harmed in the making of this utility.\n");
#endif
-- micq code
Benjamin Michotte <binny@baby-linux.net>
web : http://www.baby-linux.net
homepage : http://www.baby-linux.net/binny
icq uin : 99745024
[ Soyez précis dans vos sujets svp afin de déterminer directement ]
[ le type de demande... ]
[ Pour vous (dés)inscrire, aller sur http://linuxbe.org/ml.php ]
[ http://LinuxBe.org Contact: listmaster@linuxbe.org ]