Raspberry Pi case with shutdown function

I bought a case with a hat where I can arrange an auto shutdown. How can I do this coding on the pifi?

it concerns the following coding

First: sudo nano /boot/config.txt
Second: dtoverlay=gpio-poweroff , gpiopin18 , active_low=0
dtoverlay=gpio-shutdown , gpio_pin=17 , active_low=1 , gpio_pull=up

Hi, I believe you’d just add those lines to the bottom of /boot/config.txt like so:

################################################################################
# Bootloader configuration - config.txt
################################################################################

################################################################################
# For overclocking and various other settings, see:
# https://www.raspberrypi.com/documentation/computers/config_txt.html
################################################################################

# OpenWrt config
include distroconfig.txt

[all]
# Place your custom settings here.
usb_max_current_enable=1
# Enable the PCIe external connector
dtparam=pciex1
# Force Gen 3.0 speeds
dtparam=pciex1_gen=3

dtoverlay=gpio-fan,gpiopin=14,temp=80000

console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait ipv6.disable=1

# Custom GPIO settings for auto shutdown
dtoverlay=gpio-poweroff,gpiopin=18,active_low=0
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1,gpio_pull=up

The rest of that will already be present so it’s just adding those two lines, after that if doing it whilst Raspberry Pi is powered on I’d suggest a reboot and you should be all set!