Jpanu
Posts: 3
Joined: Fri Feb 06, 2015 3:03 pm

Bash script question

Fri Feb 06, 2015 3:07 pm

Hello all.

i have put on rc.local a line that starts my script (sleep 10;su - pi -c "/automaatio/startup.script") &
on that startup.script i start few of my scripts, BUT question is: why does not this line(on that startup.script) start: ping :/bin/ping 192.168.1.101 > /dev/null & (this is a keepalive only).

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Bash script question

Fri Feb 06, 2015 4:01 pm

What exactly is the ping command you put in rc.local?
That's not clear from your post.

Jpanu
Posts: 3
Joined: Fri Feb 06, 2015 3:03 pm

Re: Bash script question

Fri Feb 06, 2015 7:52 pm

rc.local has a line :
(sleep 10;su - pi -c "/automaatio/startup.script") &

then on this startup.script are:

source /automaatio/living.script &
/bin/ping 192.168.1.101 > /dev/null &
source /automaatio/temperature.script &
exit 0

that living.script and temperature.script starts ok. but not that ping.

edit: if i run this startup script manually, then ping works ok.

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Bash script question

Tue Feb 17, 2015 12:27 pm

Try redirecting the ping output to a log file to see if there are issues?
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Return to “Other programming languages”