2 vraagjes over freesco voor experts :)

Pagina: 1
Acties:

  • estorino
  • Registratie: Maart 2000
  • Laatst online: 07-05 20:04
Ik heb aan de hand van de uitstekende handleiding in de FAQ freesco aan de praat met mijn ADSL verbinding.
Alles prima so far, maar ik heb twee vraagjes:

1. Hoe en waar stel ik in dat automatisch gecheckt wordt of de internet verbinding (via pptp) nog "up" is? Ik wil ervoor zorgen dat dit gecheckt wordt om het uur of zo en dat wanneer de verbinding weg moge zijn, dat die dan automatisch weer reconnect. Dit kan door "rc-user stop" en "rc_user start" aan te roepen, want als ik opstart maakt ie al automatisch een verbinding.

Ik weet dat iemand dit ooit eerder vroeg op dit forum, maar ik kon de topic echt niet meer vinden en ik heb de search uitgebreid gebruikt... :'(

2. Kan ik nu freesco goed geinstalleerd is en prima loopt via flop de hele boel naar mijn hd toe gooien met "move2hdd"? Of kan dat alleen maar voor dat je freesco installeert? Als ik hem op mijn hd zet kan ik tenminste een bescheiden webserver draaien... :P

Alvast bedankt!

https://www.strava.com/athletes/10490675


  • estorino
  • Registratie: Maart 2000
  • Laatst online: 07-05 20:04
Niemand die dit weet? Of slaapt iedereen nog? :)

Ik zou je het niet kwalijk nemen, ik zou nu ook nog slapen als ik niet zou hoeven werken... (vakantiebaantje bij KPN Hosting Services van 9 tot 5) :Z

https://www.strava.com/athletes/10490675


  • marcus22
  • Registratie: Juni 2001
  • Laatst online: 21-08 23:45
Op de eerste vraag weet ik geen antwoord. Iemand anders misschien?

Het antwoord op de tweede vraag is ja. Als je het commando move2hdd uitvoerd kopieerd Freesco zichzelf naar de harde schijf. Vervolgens kun je het met een DOS bestandje (router.bat) opstarten. Dan wordt Linux gestart. Ik heb hier thuis router.bat in de autoexec.bat staan dus als ik reset komt alles goed. En dat kan achteraf ook nog, je setup wordt dan meegenomen.

Succes

There is no place like 127.0.0.1


  • estorino
  • Registratie: Maart 2000
  • Laatst online: 07-05 20:04
Ok, bedankt, ik zat dat move2hd eens gaan uitproberen...

Op mijn eerste vraag heb ik antwoord;
op het forum van freesco.org zocht ik op adsl en vond een posting van iemand uit nederland die precies dat gemaakt had voor zijn mxstream verbinding.

Een aantal commands die je aan rc_user toevoegt en checkt of je nog "up" bent en indien nodig reconnect. Ik heb het zojuist ff teruggezocht op freesco.org en hier is het:

It seems like ADSL is a bit unstable here at the moment in the Netherlands. Therefore i've been looking for a script to reconnect automatically.
Because I couldn't find it, I've wrote something myself.
I installed Freesco the way Mark Bleeker has described it in his manual. Works fine for a few months now.

When writing the script, I encountered two problems: grep command gave me a memory fault when used in a pipe. May not be a problem at your site, but I used sgrep (which is the slackware grep, installed in /rc/rcuser and renamed to sgrep then chmod 755 sgrep). I can't attached the version I used, because it's to big (30k), but I can send it via email .
Secondly the return value from the ping command was not interpreted right. Therefore the script didn't work. I did a little workaround, because I'm not an expert sys admin and don't have the time to debug it.

Here is the script: use it at your own risk. It works for me but I doesn't have to work for you!!!


start script --------------------------->>>>

#!/bin/sh
# start pptp_restart from rc_user with command 'fork pptp_restart'

CONTROL_IP=xxx.xxx.xxx.xxx; # an external IP address like your ISP's home page
DEFAULT_GW=xxx.xxx.xxx.xxx; # youre default gateway look at route command
while :; do
STAT=`ping -c 1 $CONTROL_IP | sgrep "1 packets received" | sed "s/1 packets transmitted, 1 packets received, 0% packet loss/OK/"`;
echo Status = $STAT;
if [ "$STAT" != "OK" ]; then
#double check!
STAT=`ping -c 1 $CONTROL_IP | sgrep "1 packets received" | sed "s/1 packets transmitted, 1 packets received, 0% packet loss/OK/"`;
if [ "$STAT" != "OK" ]; then
echo "Restart internet connection";
killall pptp
rm -rf /var/run/pptp
rm /var/run/ppp*
echo "remove default route....."
route del default
route del $DEFAULT_GW;
sleep 3;
pptp 10.0.0.138 file /etc/ppp/options.adsl &
sleep 5;
fi
else
sleep 60;
fi
done

<<<<<<----------------------- end script


Change the CONTROL_IP and DEFAULT_GW, replace the pptp command with the fork $PATH/pptp_restart and up you go.


To test it, start two dos or telnet sessions. On the first one, do a ping -t www.planet.nl or something, on the second do a telnet 10.0.0.138 and give the command system and then the command reboot and see what happens with your connection.

Cheers,

Frans

Bedankt Frans! :)

https://www.strava.com/athletes/10490675