Add configuration for a shutdown button

This commit is contained in:
Satu Koskinen 2023-02-18 22:29:03 +02:00
parent c05c4a4183
commit 727ab9ae83
2 changed files with 18 additions and 0 deletions

View File

@ -63,6 +63,13 @@ echo
cd "$DIR_PATH" && ./hydrophonitor/scripts/setup-pressure-depth.sh cd "$DIR_PATH" && ./hydrophonitor/scripts/setup-pressure-depth.sh
# Setup shutdown button
echo
echo "### Setup shutdown button"
echo
cd "$DIR_PATH" && ./hydrophonitor/scripts/setup-shutdown-button.sh
# Set up cron job to start the recordings at boot # Set up cron job to start the recordings at boot
echo echo
echo "### Set up a cron job to start the recordings at boot" echo "### Set up a cron job to start the recordings at boot"

View File

@ -0,0 +1,11 @@
#!/bin/bash
set -ex
echo "Setting up shutdown button"
config="dtoverlay=gpio-shutdown,gpio_pin=21,gpio_pull=up,active_low=1"
if ! grep -q "$config" /boot/config.txt; then
echo "$config" | sudo tee -a /boot/config.txt
fi