hydrophonitor/scripts/setup-shutdown-button.sh

12 lines
226 B
Bash
Raw Normal View History

#!/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