Send multiple kodi actions in one script

Hi,

to refresh my libary and clean it, i connect via ssh and write these command:

xbmc-send --action="CleanLibrary(video)"
xbmc-send --action="UpdateLibrary(video)"

it works fine.

But now i would like to perform these commands in one script. Like “refresh.py”
Is there a solution to do that ?

Would be perfect.

thx

Sure:
Create a new file:
touch maintenance.sh

Make it executable:
chmod +x maintenance.sh

Open it and put your commands in. One per line:
nano maintenance.sh

Close the editor with ctrl +x and save.

Run your new bash script:
./maintenance.sh

nice thanks! can i make a pause between the scripts, or wait till the first script has finshed ?

The lines in the script will be executed one after another.
If you need a longer pause in between, add a line in between with:
sleep x

Where x is a number in seconds to wait before doing the next command.

If you want to know more about bash scripting, here is a good tutorial:

It will work without, but to be safe, the first line of your script should be:
#!/bin/bash

Thank you very much :slight_smile:

See my edit.
Put everything in codetags now so it is not messed up by the forum. The # got removed in the section quoted by you.

If you want to go even more automated, google for cron.

i would more like to map this script to my IR Remote. So that i push a button, it starts.
But i cant finde the file where i can change the buttons.
The standard buttons are working. But where can change them? You know that?

Search the forum for “script on remote press”

This should help you on your way: http://kodi.wiki/view/Keyboard.xml
btw, i would swap the order clean and update :wink: