# Using NESPI case with DietPi

**URL:** <https://dietpi.com/forum/t/using-nespi-case-with-dietpi/6235>\
**Category:** Community Tutorials\
**Created:** [25 January 2022 05:38 UTC](https://dietpi.com/forum/t/using-nespi-case-with-dietpi/6235 "2022-01-25T05:38:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaspyPi](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@RaspyPi](https://dietpi.com/forum/u/RaspyPi)\
**Post date:** [25 January 2022 05:38 UTC](https://dietpi.com/forum/t/using-nespi-case-with-dietpi/6235/1 "2022-01-25T05:38:40Z")

</div>

If you would like to use the nespi case which has reset and power off buttons. I have used the following scripts from [https://github.com/Denisuu/OSMC\_NesPi-SuperPi\_Safe-Shutdown](https://github.com/Denisuu/OSMC_NesPi-SuperPi_Safe-Shutdown)

I made the following changes for dietPi:

From the readme.md I changed these steps:

Step 2 run:

```nohighlight
mkdir -p /home/dietpi/scripts && cd /home/dietpi/scripts && wget https://raw.githubusercontent.com/Denisuu/OSMC_NesPi-SuperPi_Safe-Shutdown/master/multi_switch.sh && chmod +x multi_switch.sh

```

For step 3:  
I create a autostart service call nespi (sudo nano /etc/systemd/system/nespi.service)  
The content are of the nespi.service are :

```nohighlight
[Unit]
Description=Nespi GPIO Init
After=network.target

[Service]
ExecStart=/home/dietpi/scripts/multi_switch.sh --nespi+

[Install]
WantedBy=multi-user.target

```

To test nespi service run

```nohighlight
sudo systemctl daemon-reload
sudo systemctl start nespi.service

```

To add the nespi service to autostart

```nohighlight
sudo systemctl enable nespi.service

```

Credits to Denisuu for creating the script!

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [25 January 2022 08:46 UTC](https://dietpi.com/forum/t/using-nespi-case-with-dietpi/6235/2 "2022-01-25T08:46:50Z")

</div>

just as a side node. On DietPi, there is no user pi existing. Therefore it doesn’t make sense to create a home directory /home/pi/ for it. You should be able to use home directory of user dietpi.

---

<div class="post-metadata">

**Author:** ![RaspyPi](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@RaspyPi](https://dietpi.com/forum/u/RaspyPi)\
**Post date:** [26 January 2022 00:28 UTC](https://dietpi.com/forum/t/using-nespi-case-with-dietpi/6235/3 "2022-01-26T00:28:28Z")

</div>

Makes sense I have made the changes to the tutorial 🙂
