Trying to make a simple power off / reboot button in Emulationstation but getting permission denied.
-
I'd like to add a power off & reboot button to my emulation station game menu where I select an icon from my game menu to perform one of these functions but I'm getting permission denied errors trying to do it.
I've seen other builds have a file called like reboot.sh or shutdown.sh and when you select it, it sends the command:
sudo shutdown -r nowor
sudo shutdown -h now
But everytime I've tried to do something like this I get "permission denied." What am I doing wrong here?
-
@TPR what system are you putting them in?
Sounds like the es_system you put them in is missing bash some command.
You could just make the scripts executable with chmod 755 script. sh, or modify es_systems cfg to bash %ROM%. -
@RapidEdwin08 said in Trying to make a simple power off / reboot button in Emulationstation but getting permission denied.:
@TPR what system are you putting them in?
Sounds like the es_system you put them in is missing bash some command.
You could just make the scripts executable with chmod 755 script. sh, or modify es_systems cfg to bash %ROM%.At the moment, to test, just putting them in a folder called "power"
<system>
<name>power</name>
<fullname>Power Menu</fullname>
<path>~/RetroPie/roms/power</path>
<extension>.sh .SH</extension>
<command>%ROM%</command>
<platform>linux</platform>
<theme>power</theme>
</system>and then my reboot.sh just has this line in it:
sudo shutdown -r nowBut then I get the following error on screen:
sh: 1 /home/pi/RetroPie/roms/power/Reboot.sh: Permission deniedI've seen this work on other builds with the same command so I'm not sure I'm doing wrong.
my chmod on the reboot.sh file is 755, along with all my other files in the /roms folder.
Any ideas?
-
@RapidEdwin08 said in Trying to make a simple power off / reboot button in Emulationstation but getting permission denied.:
@TPR what system are you putting them in?
Sounds like the es_system you put them in is missing bash some command.
You could just make the scripts executable with chmod 755 script. sh, or modify es_systems cfg to bash %ROM%.So you were totally right!
This now works!
<system>
<name>power</name>
<fullname>Power Menu</fullname>
<path>~/RetroPie/roms/power</path>
<extension>.sh .SH</extension>
<command>bash %ROM%</command>
<platform>linux</platform>
<theme>power</theme>
</system>adding bash in front of %ROM% got me my desired effect!
-
I usually do from any navigation position: Start -> RB (right shoulder) -> A (now I am in the Quit Menu) and then select either Restart or Shutdown. You can bypass the final confirm dialog when you add
--no-confirm-quit
to the emulationstation line inautostart.sh
. -
@Lolonois said in Trying to make a simple power off / reboot button in Emulationstation but getting permission denied.:
I usually do from any navigation position: Start -> RB (right shoulder) -> A (now I am in the Quit Menu) and then select either Restart or Shutdown. You can bypass the final confirm dialog when you add
--no-confirm-quit
to the emulationstation line inautostart.sh
.Yes, I am well aware of that. Have been using ES for many years. I just wanted to make an easy button to press right from the icon screen though. More of a personal preference than anything else.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.