Shutdown script please for rpi3b

I am trying dietpi rpi3b for logitech media server to manage server and player for my hardware squeezebox classic.

I wrote the dietpi image and configured it headless with putty on windows 10.

Two ssd drives are mounted on the rpi3b and they are mounted after pulling the plug. I need to switch the pi off as these drives are not powered down even when LMS is off.

I did have to rescan as some of the folders were missing.
How can I trigger poweroff or shutdown in putty or better yet an iOS app?

Hi,

on command line you could use poweroff or shutdown. But physically your board will be still powered. But this has nothing to do with DietPi, it’s a behaviour of SBC in general. For this you would need a physical power switch on the power adapter or a case who will take care on this.

I need a command that would end processes and service so that there is less chance of “losing” my folders after I unplug the rpi3b.

Sounds like I will rely on the putty commandline as Lms doesn’t control the raspberry pi.

Thanks for your help

Probably better to check on a LMS specialized forum if you like to control the device out of this stack

Poweroff did shut down the connection on Putty, and the drive turned off after two minutes.
That’s a good result, as the rpi3b draws very little power in this state.

Dietpi isn’t known on the best squeezebox forum for some reason. I am really enjoying the flexibility of the Dietpi os, but I only had to install the music drive, alsa and change the server to OpenSSH to get what I wanted.
The other dedicated music os’ were very buggy in my experience.

The downside is that there isn’t a developer on Squeezebox forum that works on Dietpi.

The poweroff preserved my settings and shut down both rpi3b and network player. That’s the squeezebox Classic.

I reestablished connection by unplugging and plugging in; both player and lms came online with the last stream ready.

Any chance of getting power on from the terminal?

It is also possible to boot the RPi 3B by briefly shorting GPIO pins 7 & 8. e.g., I awaken my sleeping RPi by closing the gap between GPIO pins 7 & 8 using a small flat head screwdriver.

Any chance of getting power on from the terminal?

No, this has nothing to do with DietPi. By default it’s simply not possible to power on a RPi from remote. To have an RPi powered on/off remotely, you would need some remote control hardware or the screwdriver :rofl:

As an alternative, you could use a smart home plug to power cycle your RPi

Personally I’m using a PoE switch to be able to power cycle my test devices. So I don’t have to go to the technic room always :sunglasses:

BTW: DietPi is not an own OS. It’s a set of scripts on top of a base image. In case of Raspberry Pi, base image used is Raspberry OS. DietPi is an extrem slim/diet version of Raspberry OS with a reduced amount of packages.