Hey everyone, thanks a bunch for all of the help thus far. Hopefully someday I will understand these systems much better then i currently do...
I am trying to run a script to initiate the shutdown sequence when the ff switch is triggered. I had no issue getting this to work on Noobs, but will not work on DietPi. I am using a Mausberry Circuits car switch, and going through their listed method to install the script. So far, it will not run.
This is the script in the .SH file that came directly from Mausberry Circuits (https://www.mausberrycircuits.com/pages/setup):
#this is the GPIO pin connected to the lead on switch labeled OUT
#this is the GPIO pin connected to the lead on switch labeled IN
echo "$GPIOpin1" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio$GPIOpin1/direction
echo "$GPIOpin2" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio$GPIOpin2/direction
echo "1" > /sys/class/gpio/gpio$GPIOpin2/value
while [ 1 = 1 ]; do
if [ $power = 0 ]; then
done' > /etc/switch.sh
sudo chmod 777 /etc/switch.sh
sudo sed -i '$ i /etc/switch.sh &' /etc/rc.local
I have tried several methods to run the script, but I am getting a number of error such as
root@DietPi:~# sudo bash setup.sh
setup.sh: line 1: !DOCTYPE: No such file or directory
setup.sh: line 2: syntax error near unexpected token `newline'
setup.sh: line 2: ` "http://www.w3.org/TR/html4/strict.dtd">'
I am outclassed here. This is way beyond my knowledge to modify, change, or even understand what is wrong...Is there something so vastly different about DietPI that would make this work in Noobs but not this?
Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
1 post • Page 1 of 1