Forum
Restart xbmc with script? - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Others (/forum-24.html)
+--- Thread: Restart xbmc with script? (/thread-1325.html)



Restart xbmc with script? - Takenover83 - 7th Sep, 2013 09:12 AM

I recently installed retropie on Xbian. I need a script to possibly restart xbmc, without su permissions.

I will be launching this script via emulationstation and a keyboard will not be plugged in. I know xbmc can restarted with "sudo service xbmc start". But is there a way to do it without sudo? So I will not be prompted to type a password?

I am open to any idea's.


RE: Restart xbmc with script? - kraleksandr - 7th Sep, 2013 03:46 PM

Terminal
xbian@xbian ~ $ cat xbres.sh
#!/bin/bash
service xbmc stop
service xbmc start
xbian@xbian ~ $ sudo cat /etc/sudoers | grep xbres
xbian ALL=(ALL) NOPASSWD: /home/xbian/xbres.sh
Just run "sudo /home/xbian/xbres.sh" and your XBMC will (re)start.


RE: Restart xbmc with script? - Takenover83 - 7th Sep, 2013 04:42 PM

(7th Sep, 2013 03:46 PM)kraleksandr Wrote:  
Terminal
xbian@xbian ~ $ cat xbres.sh
#!/bin/bash
service xbmc stop
service xbmc start
xbian@xbian ~ $ sudo cat /etc/sudoers | grep xbres
xbian ALL=(ALL) NOPASSWD: /home/xbian/xbres.sh
Just run "sudo /home/xbian/xbres.sh" and your XBMC will (re)start.
Thanks for that. Does the "service" command work for normal user's? I remember trying it I think as a normal user, and got command not found. Worked fine when I threw sudo in front of it. In any case, I will give this a test later. Thanks again.


RE: Restart xbmc with script? - namtih - 7th Sep, 2013 04:53 PM

(7th Sep, 2013 04:42 PM)Takenover83 Wrote:  Thanks for that. Does the "service" command work for normal user's? I remember trying it I think as a normal user, and got command not found. Worked fine when I threw sudo in front of it.

The "service" command will need a password.
But please check the last 2 commands posted by kraleksandr:
Terminal
xbian@xbian ~ $ sudo cat /etc/sudoers | grep xbres
xbian ALL=(ALL) NOPASSWD: /home/xbian/xbres.sh

You can edit "/etc/sudoers" and allow your script to run without extra sudo command.


RE: Restart xbmc with script? - Takenover83 - 7th Sep, 2013 05:58 PM

Thanks for clarifying. Just tested and it worked great.


RE: Restart xbmc with script? - eirawalker - 18th Mar, 2022 02:21 PM

However, one of the problems with retropie is that sometimes it doesn't want to start up correctly and will stay stuck at the logo screen. venge io taming io