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
Safety Shutdown by a Reset Button
Re: Safety Shutdown by a Reset Button
thank you i will just need to translate this to english-us and it will work fine i think.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
Re: Safety Shutdown by a Reset Button
Please provide instruction on how to add this script?
Re: Safety Shutdown by a Reset Button
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.
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.