Scripting help for autostart

Here for general support for B series TVs, request and problem solve area.
Post Reply

arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: Scripting help for autostart

Post by arris69 »

bmwskead wrote:Hello together,

I need a little bit of help with bash scripting. I want to modify SamyGo.sh a little bit and do not really know the right linux command for this. What I wanted to is the following:

1. if (remoteip is reachable) { do something }
How can I do "remoteip is reachable" in a programmatic way?

Code: Select all

ping -c 2 10.0.0.99 || echo "host 10.0.0.99 down"

Code: Select all

ping -c 2 10.0.0.99 && echo "host 10.0.0.99 up"
2. if(smb share is mounted correctly) { do something }
How can I do "smb share is mounted correctly" also in a programmatic way?
what you mean with "mounted correctly"?
btw. you can look into the init scripts of extensions pack to see how to check hosts/mounts etc....
Thank you very much for your help :)
hth
arris
arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: Scripting help for autostart

Post by arris69 »

bmwskead wrote:thank you very much arris :)

i have another question: might there been also something possible like:

while(tv has not an ip adress) { wait }
if(ping to remoteip succeed) { do something }
it's all possible. http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html
but i recommend not to write one a big fat script to handle all possibilities what you get in your mind.
better use the "extensions pack" it's more simple and linux style, you can add also your own scripts

i think you'll find the wiki page and the support threads ;)

arris

Post Reply

Return to “[B] Support”