hi, I am completely new to osmc and the linux language. I have a raspberry pi Model A. I added the pidrive (314 Gb harddrive) to it and copied movies onto it so my kids can watch them in the car ( screens are built into the head rest). The pi mediacenter works great as it is, but i have to get out and shut it down thru the onscreen menus before i turn off the car (pi and pidrive get power from car 120v outlet in car). What i want to do is add a push button to the pi and have it shut itself off (easier and faster for my kids to deal with). I found a product that does this,
the RemotePi ( http://www.msldigital.com/ ).
they provide instructions on how to add a line of code to the rc.local that calls another shell script that monitors the button and triggers a shutdown sequence.
just what i am looking for. I donât need the IR receiver hardware, i just need to add a button and to get this script to work. Problem is, i canât get it to work. I have spent several days researching how the different parts work and have tried debugging it with no success. at this point i am just trying to verify that the rc.local is able to call another script that creates a txt file telling me that part works, but i canât even get that to work. Here is what my rc.local looks like:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# original code from RemotePi
# (/etc/irswitch.sh)&
#debug code i am working with
sudo /etc/samplerun.sh
exit 0
and my testing script is here samplerun.sh:
#!/bin/bash
sudo echo "new test" > testfile2.txt
exit 0
I use PuTTy on my windows desktop to access the pi and when osmc is running i can run rc.local just fine, it creates the txt file correctly but when i reboot it, no file is created.
I am at a loss for what to do next, any help would be appreciated.
thx, Michael