[Tips] Install addons with a shell script / commands
#1
[Tips] Install addons with a shell script / commands
(tested on RPi3)

Manually unzip to addons directory alone will not make those addons recognized by kodi.
They need to be added to addons database, enable and refresh data to be ready to use.
  • download > extract to /home/osmc/.kodi/addons
  • check depends in ./<addon_dir>/addon.xml field <requires>
  • download the <requires> addons > extract to /home/osmc/.kodi/addons
  • check each new addon.xml for other <requires>
  • add addons to database
  • enable each addon in database
  • refresh addons data
  • restart kodi

An example script for install skin.shortcuts
Code:
#!/bin/bash

kodipath=/home/osmc/.kodi/userdata
addonpath=/home/osmc/.kodi/addons
pkgpath=$addonpath/packages
dbpath=$kodipath/Database

# for 'unzip'
apt install -y bsdtar

# download addon and 'requires'
wget -qN --show-progress https://github.com/BigNoid/script.skinshortcuts/archive/master.zip -O $pkgpath/script.skinshortcuts.zip
wget -qN --show-progress https://github.com/XBMC-Addons/script.module.simplejson/archive/master.zip -O $pkgpath/script.module.simplejson.zip
wget -qN --show-progress http://mirrors.kodi.tv/addons/jarvis/script.module.unidecode/script.module.unidecode-0.4.16.zip -O $pkgpath/script.module.unidecode.zip

# extract
bsdtar -xf $pkgpath/script.skinshortcuts.zip -C $addonpath
bsdtar -xf $pkgpath/script.module.simplejson.zip -C $addonpath
bsdtar -xf $pkgpath/script.module.unidecode.zip -C $addonpath
chown -R osmc:osmc $addonpath

# add addons to database
xbmc-send -a "UpdateLocalAddons()"
sleep 2 # wait for database finished

# enable addons in database
sqlite3 $dbpath/Addons27.db "UPDATE installed SET enabled = 1 WHERE addonID = 'script.module.simplejson'"
sqlite3 $dbpath/Addons27.db "UPDATE installed SET enabled = 1 WHERE addonID = 'script.module.unidecode'"
sqlite3 $dbpath/Addons27.db "UPDATE installed SET enabled = 1 WHERE addonID = 'script.skinshortcuts'"

# refresh addons data (neeeded for reloadskin - may not for restart)
xbmc-send -a "UpdateLocalAddons()"
sleep 2 # wait for database finished

# restart kodi
systemctl restart kodi
Reply
#2
This is absolutely NOT recommended and possibly breaks everything.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply

Logout Mark Read Team Forum Stats Members Help
[Tips] Install addons with a shell script / commands0