[REQUEST] Help mkaking a simple ping script
#1
Hi guys, Im new to all this, never really done a script in my life, very new to linux too.

Im running Ubuntu 10.04 and the current version of XBMC

now I have a NAS box i use to hold all my media, but its abit crappy and falls asleep alot during playback and file transfers, the only way ive found to prevent it from doing this is to run a continuous poing to it.
This has always worked in windows and also solve the same issue in ubuntu when using xbmc.

Now ive found that once i start xbmc and press CTRL+ALT+F1 to go to the console screen i can initiate a simple continuous ping by simply typing the command
'ping [ip address]'

So my question, is there anyway to add this to a startup script somehow.

I know it may sound like a wierd one, and really i should just fork out for a new NAS box instead, but other than this its a decent box and this is the only way ive found to solve its problems.
Like I said, ive not done scipts before, but i am a good learner if someone can point me in the right direction.

Thanks for reading, hope someone can give some input.
Reply
#2
isn't it a bad configuration on NAS side ? should be a better way to handle that.

you can make a python script running at xbmc startup with autoexec.py
Reply
#3
so how would i go about entering the commands in such a file, can i simple enter the lines i would do into the console, or do i need to identify them as console commands at all.

sorry, like i said, ive never done scripting before, never touched python and dont really know my way round linux much either.
Reply
#4
pop the commands into a bash script call it what you want (for my example i'm gonna call it ping-nas) and make it executable... then:

sudo nano ~/.xbmc/scripts/autoexec.py

and then:

import os
os.system('/home/username/ping-nas')

save and restart xbmc Smile

thanx to Bagger who informed me here that if you pop a script called autoexec.py into the scripts folder then this will be executed on start Smile
Reply

Logout Mark Read Team Forum Stats Members Help
[REQUEST] Help mkaking a simple ping script0