18-08-2006, 23:23
|
|
|
חבר מתאריך: 01.03.06
הודעות: 21
|
|
חיבור מחדש אוטומטי לאינטרנט אם נופל
שלום רב ברצוני להתחבר לאינטרנט אוטומטית ברגע שנופל לי החיבור
אני על slackware 10.2
עשיתי עדכון לרוב הדברים מ current
kernel 2.4.33
ובגדול הספריה של הסקריפטים היא ב
/etc/rc.d
אני כרגע משתמש בסקריפט הבא
#!/bin/bash
# Killing if still running pptp/pppd services
/bin/killall -HUP pppd
/bin/killall -HUP pptp
USERNAME="$1"
IFACE="$2"
#for gold lines (012)
PPTPS="cablepns.012.net.il" # edit this to your isp connect address
DNS1="84.95.14.250" #DNS of your isp
DNS2="212.116.161.38" #same
#DNS3="212.150.48.10"
#For netvision
#PPTPS="cable.netvision.net.il"
#DNS1="194.90.1.5"
#ifup/ifdown commmands, not in gentoo house
#ifdown $IFACE
#ifup $IFACE
#instead, restarting the device via init scripts
/etc/rc.d/rc.inet1 restart
echo nameserver 192.168.101.102 > /etc/resolv.conf
NVGW=$(host $PPTPS | cut -d" " -f4 | cut -f3 | tail -n 1)
#CABLEGW=172.28.96.1
#Auto finding gatway, if changed.
CABLEGW=$(grep GATEWAY /etc/dhcpc/dhcpcd-eth0.info | tail -n 1 | cut -d "="
-f2)
#Manually defined GW, or use of non-NAT router
# CABLEGW=192.168.2.1
echo Adding route point to $NVGW through $CABLEGW
route add -host $NVGW gw $CABLEGW
echo Dialing to $NVGW with the user $USERNAME
/usr/sbin/pptp $NVGW debug user $USERNAME mtu 1460 mru 1460 defaultroute persist
echo Waiting for 7 seconds
sleep 7
NEWGW=$(ifconfig ppp0 | grep inet | cut -d":" -f3 | tail -n 1 | cut -d" " -f1)
echo Removing gateway $CABLEGW adding gateway $NEWGW
route add default gw $NEWGW
route del default gw $CABLEGW
echo Adding DNS servers $DNS1 , $DNS2 , $DNS3
echo nameserver $DNS1 > /etc/resolv.conf
echo nameserver $DNS2 >> /etc/resolv.conf
#echo nameserver $DNS3 >> /etc/resolv.conf
אשמח אם אקבל תשובה לפני יום שבת בלילה כי אני ממש ממהר ויום שבת אני נוסע חזרה ללימודים ואני לא אהיה ליד המחשב הרבה זמן בגלל זה רצוני שאם זה יתנתק אני אוכל לגשת אליו מרחוק תודה מראש!!
נערך לאחרונה ע"י dangold בתאריך 18-08-2006 בשעה 23:26.
|