diff --git a/mpdtosystemshutdown.service b/mpdtosystemshutdown.service new file mode 100644 index 0000000..edd245d --- /dev/null +++ b/mpdtosystemshutdown.service @@ -0,0 +1,13 @@ +[Unit] +Description=MPD to system shutdown + +[Service] +ExecStart=/bin/sh -c "sleep 1 && /usr/bin/inotifywait -e open /media/media/Music/0others/shutdown.mp3 && mpc del 0 && shutdown -h now" + +[Install] +WantedBy=multi-user.target + +# Courtesy of: http://hannes.enjoys.it/blog/2014/07/shutting-down-the-operating-system-by-playing-a-kill-song-in-mpd/ +# When MPD tries to play file, Linux will shut down. +# Copy to /etc/systemd/system/mpdtosystemshutdown.service +