Page 1 of 1

Safety Shutdown by a Reset Button

Posted: Thu 6 Jul 2017 15:37
by liolabs1973
Hi,

Here is a small shell script who's can be include in the Raspiboy to perform a safety shutdown

Have fun...
Lionel

#!/bin/bash

setup ()
{
echo Setup
gpio mode 2 in ; // si biensur le pin 2 est dispo
}
setup
while :
do
result=`gpio read 2`
if [ $result -eq 0 ]; then
echo BUTTONPRESSED /dev/null sudo init
6 // qui execute un soft-reset en démontant proprement le file system

fi
sleep 0.1
done

Re: Safety Shutdown by a Reset Button

Posted: Sat 19 Aug 2017 22:33
by pbhound
liolabs1973 wrote:Hi,

Here is a small shell script who's can be include in the Raspiboy to perform a safety shutdown

Have fun...
Lionel

#!/bin/bash

setup ()
{
echo Setup
gpio mode 2 in ; // si biensur le pin 2 est dispo
}
setup
while :
do
result=`gpio read 2`
if [ $result -eq 0 ]; then
echo BUTTONPRESSED /dev/null sudo init
6 // qui execute un soft-reset en démontant proprement le file system

fi
sleep 0.1
done
thank you i will just need to translate this to english-us and it will work fine i think.

Re: Safety Shutdown by a Reset Button

Posted: Thu 24 Aug 2017 16:10
by thexter
Please provide instruction on how to add this script?

Re: Safety Shutdown by a Reset Button

Posted: Fri 25 Aug 2017 16:32
by chris_jh
This script may work, but you will not be able to copy and paste it as the formatting is not quite right.
liolabs1973 you needed to use the Code button when posting.

Also it will require wiring up and install a physical button to the RaspiBoy, to pin 2 and ground i think.

If you want to do this, rather than Pressing Start, Selecting Quit and Shutdown.

Then may i suggest you following this guide.

https://www.hackster.io/masteruan/raspb ... ton-576c74

But again it will require modification to the RaspiBoy.

Do at your own risk, i take no responsibility.