#!/bin/bash case $1 in suspend) /etc/rc.d/mpd stop chvt 1 ;; resume) chvt 7 /etc/rc.d/mpd start & ;; esac