Jump to content
jdotero

Restart emby service from Shell Script

Recommended Posts

jdotero

Hello,

 

I am trying to figure out how to restart the emby service from the command line via a shell script.  I tried using the 'service emby-server restart' command but I don't think the ReadyNAS registers emby as a standard service.

 

Bit of background on why I want to do this:  I want to use SSL and certificates form a certificate authority.  But I want to do this for free, which means I am using Let's Encrypt to generate the certificates for me.  Issue is that I need to regenerate the certificates every 90 days.  So I want to do this via cron every 90 days.  This means the shell script needs to do the following (somewhat simplified for this posting) 1) get the new certificate from Let's Encrypt using cert-bot, 2) take all the cert files and build a PFX file suitable for emby 3) move the PFX files onto the emby server  (steps #1 and #2 are done on my debian server) and #4) reboot the emby server (this command too would be issued to the emby server from the remote debian server through an ssh pipe).   I have everything working except for the last step.

 

Any hints that anyone can give me about restarting the emby server from the command line on the ReadyNAS would be appreciated.  And hopefully I can do this as user emby rather than root, as I will issue the reboot command through a piped ssh command and don't want to do that as root.

 

Thanks for your help!

 

Share this post


Link to post
Share on other sites
Luke

hi, you could always do it by sending an http request to /System/Restart

Share this post


Link to post
Share on other sites
jdotero

Hmmm.  Suppose I can do that.  Doesn't seem like the most elegant approach but in many ways that is quite simple and would not require much effort.  Suppose I can also 'sudo /sbin/shutdown -r now' as well.   If there are no other approaches to restarting just the emby service I will likely do what you suggest.  Thanks for the idea.

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...