Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Mon Jun 25, 2018 3:18 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Nov 29, 2009 2:07 pm 
Offline
Newbie

Joined: Sun Nov 20, 2005 7:40 pm
Posts: 51
Just a litte hint for pepole who want to netcat a u-booted ls2 via a crossover cable: it might fail, because loading the u-boot module causes a little network outage. You can see it in dmesg on your host computer:
Code:
[ 6294.622725] r8169: eth0: link down

My solution here will penetrate route and as soon as it sees that eth0 is down, it will run ifconfig to re-activate it. I've used a poll interval of 0.1 seconds, which is small enough here to call netcat soon enough (the moment where you need to press 's').
Code:
loop=1; while [ "$loop" == "1" ]; do route | grep eth0; if [ $? -gt 0 ]; then loop=0; fi; sleep 0.1; done; ifconfig eth0 192.168.11.149; ./nc_ls2.sh

./nc_ls2.sh calls netcat:
Code:
nc -u -p 6666 -v -v 192.168.11.150 6666


Or just use this summarized script to call netcat:
Code:
#!/bin/sh
loop=1
while [ "$loop" == "1" ]; do
  route | grep eth0
  if [ $? -gt 0 ]; then
    loop=0
  fi
  sleep 0.1
done
ifconfig eth0 192.168.11.149
nc -u -p 6666 -v -v 192.168.11.150 6666


Top
   
PostPosted: Wed Dec 02, 2009 12:48 am 
Offline
Newbie

Joined: Sun Nov 20, 2005 7:40 pm
Posts: 51
Use the following script. It's better, because it doesn't wait for eth0 to go down, but for eth0 to come up. So you can use it when booting (powering on) the ls2. The other one worked for calling ./u-boot-load.sh only.

P.S.: The web is a much more secure place for backing up my scripts, that's why I keep posting them.... ;)
Code:
#!/bin/sh
loop=1
while [ $loop -eq 1 ]; do
  sleep 0.1
  dmesg | tail -1 | grep "link up" > /dev/null
  if [ $? -eq 0 ]; then
    loop=0
  fi
done
ifconfig eth0 192.168.11.149
nc -u -p 6666 -v -v 192.168.11.150 6666


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited