Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: elrick on August 30, 2013, 11:00:58 AM
-
Hi guys,
I need your help. I'am trying to set up Putty, to load session on startup in Core Plus. I've wrote short script:
putty -load SessionName
I've saved file as putty.sh and I placed it in .X.d folder, its working, but it fails to load session, I think its because network is not ready, so how can I delay startup of putty?
I tried:
putty -load SessionName | wait:20s
putty -load SessionName -wait:20s
putty -load SessionName -wait 20
putty -load SessionName -sleep:20s
and few other configurations, nothing works, what am i doing wrong?
-
Hi elrick
I think its because network is not ready, ...
See this thread:
http://forum.tinycorelinux.net/index.php/topic,15806.msg92705.html#msg92705
-
hi elrick,
perhaps you were looking for the sleep command?
#!/bin/sh
sleep 10
putty -load SessionName
-
Hi netnomad
If his problem is waiting for the network card to be ready, the solution posted by gerald_clark in the thread I linked to
is more robust.
-
Yes, a fix dealay is a bad practice, just a final solution. Much better to wait for the network is up with timeout.
-
there is no doubt ;-)
-
Thanks guys, I will try this later on and let you know if its works.
-
ok its working but not always, I have two separate networks, maybe that's causing problems, when my PC is connected to the hub and to the one of networks, script is working, and when it's boot I can see IP address for a second, when my PC is connected to the other network, when it boot I see quick message "sending discover" or "waiting for IP 60", after this putty fails to load session, and its taking about 30-60 seconds network to start working.
Here my bootlocal.sh script:
#!/bin/sh
~ put other system startup commands here
/opt/eth0.sh &
SEC=60
while [ $SEC -gt 0 ] ; do
ifconfig | grep -q "Bcast" && break || sleep 1
echo -ne "Waiting for IP $((SEC--)) \r"
done
echo
and putty.sh in .X.d folder
#!/bin/sh
putty -load SessionName