Linux Execute script when starting addons
#1
I am wondering if XBMC is able to run a script prior to starting an addon?

For example, I use a DNS service that allows me to get some foreign streaming content, but it requires that I change my DNS; however when I do this, some of the local streamed programming fails with the 'You are in an unsupported region'. My solution thus far is to add a line to the beginning of the default.py scripts for the addons that require it:

Code:
os.system("cp /etc/resolv.remote /etc/resolv.conf ; sleep 1")
or
Code:
os.system("cp /etc/resolv.local /etc/resolv.conf ; sleep 1")
The
Code:
sleeo 1
is just to ensure the DNS is changed prior to the rest of the python script running.

The issue is when upgrades come along, the default.py files will be changed, so I am wondering if there is a way that XBMC can run a script prior to starting an addon? Preferrably with some variables that would contain the addon information, so some logic can be performed.


Thanks!
Reply
#2
No, there is no such facility.

However you can write a script to do whatever you want then start the add-on. This means it's still one-click to open the add-on, and any updates to the add-on will have no effect.
Reply

Logout Mark Read Team Forum Stats Members Help
Execute script when starting addons0