Jump to content
kegham

Restart Service from the command line

Recommended Posts

kegham

Hello!

I would like to know if I can restart the Emby plugin from the command line. I'm doing s script to restart the service once the connection with the server is reestablished, since the plugin can't reconnect to the server unless I restart the app.

Thanks!

 

Share this post


Link to post
Share on other sites
Luke

Hi, what exactly do you want to restart? Kodi, or Emby Server?

Share this post


Link to post
Share on other sites
kegham

I would like to restart the Emby plugin itself. At the moment I'm restarting manually in the Kodi app >> Addons > Restart Emby for Kodi.

 

Share this post


Link to post
Share on other sites
Luke

@jachin99 do you know if this is possible?

Share this post


Link to post
Share on other sites
Luke
40 minutes ago, jachin99 said:

I use eventghost to send python commands to emby for Kodi.  Here is a list of actions that are compatible with e4k but it's up to you to figure out how to execute them from the command line. https://github.com/MediaBrowser/plugin.video.emby/wiki/Actions

Thanks !

Share this post


Link to post
Share on other sites
kegham

I think eventghost doesn't work on linux. If I make a python script to call one of those actions, importing the xbmc module, will it work?

I think this "xbmc.executebuiltin('RunPlugin(action)')" would be the command that I need...

Share this post


Link to post
Share on other sites
Luke

Sounds like it's worth a shot.

Share this post


Link to post
Share on other sites
jachin99

I'll have to look at my script but that looks about right

Share this post


Link to post
Share on other sites
kegham

I did it via the command line with this package "xbmc-eventclients-xbmc-send". I just created a simple python script to execute the restart action:
 

#!/usr/bin/env python

import xbmc
xbmc.executebuiltin('RunPlugin(plugin://plugin.video.emby?mode=restartservice)')

and called the command:

xbmc-send --action='RunScript("/home/osmc/.kodi/addons/temp/restart-emby.py")'

Doing without the xbmc-send the module xbmc would't import, since kodi have a build-in python version.

Now it works, just what I need it. Thanks!

Share this post


Link to post
Share on other sites
Luke

Thanks for the feedback !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...