2006-06-15, 12:32
any python devs out there who could knock up a small peice of code for me ?
on my xbmc home screen i've got startonlan/shutonlan icons to start and stop my server. using the <onclick> command i execute 'wol'.py or 'sol.py' from my scripts dir. ive added the executebuiltin() function of xbmc in these scripts to run a notification() informing the command has been accepted and the server is either starting or stopping.
i would like to further enhance this code if possible and would like some help.
what i would like to do is after the command has been executed ping an address (192.168.1.2 for instance) every 5 seconds or so, put this in a loop and when a response is recieved from the ping issue an xbmc notification() the server is online and exit the script.
the same for shutdown, ping the address until no reply is received and issue a xbmc notification() the server is stopped.
im sure others would benefit from this as well as myself, so if anyone can help out it would be great.
thanks.
on my xbmc home screen i've got startonlan/shutonlan icons to start and stop my server. using the <onclick> command i execute 'wol'.py or 'sol.py' from my scripts dir. ive added the executebuiltin() function of xbmc in these scripts to run a notification() informing the command has been accepted and the server is either starting or stopping.
i would like to further enhance this code if possible and would like some help.
what i would like to do is after the command has been executed ping an address (192.168.1.2 for instance) every 5 seconds or so, put this in a loop and when a response is recieved from the ping issue an xbmc notification() the server is online and exit the script.
the same for shutdown, ping the address until no reply is received and issue a xbmc notification() the server is stopped.
im sure others would benefit from this as well as myself, so if anyone can help out it would be great.
thanks.