diff options
author | root <root@rshg047.dnsready.net> | 2011-06-17 23:02:42 +0000 |
---|---|---|
committer | root <root@rshg047.dnsready.net> | 2011-06-17 23:02:42 +0000 |
commit | e96f6ac6e912185a495a99af2b0d51b73bd1d044 (patch) | |
tree | dbd018fc8e267c419876cd604cebed805287bf6c /testing/mpd/mpd.install | |
parent | 1fcb176285908c33aca3b0f5cb703ec098e5440c (diff) |
Fri Jun 17 23:02:42 UTC 2011
Diffstat (limited to 'testing/mpd/mpd.install')
-rw-r--r-- | testing/mpd/mpd.install | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/mpd/mpd.install b/testing/mpd/mpd.install new file mode 100644 index 000000000..885505a07 --- /dev/null +++ b/testing/mpd/mpd.install @@ -0,0 +1,18 @@ +post_install() { + post_upgrade + echo "==> Create a configuration file /etc/mpd.conf before using MPD (example: /usr/share/mpd/mpd.conf.example)" +} + +post_upgrade() { + getent group "mpd" &>/dev/null || groupadd -r -g 45 mpd 1>/dev/null + getent passwd "mpd" &>/dev/null || useradd -r -u 45 -g mpd -d "/var/lib/mpd" -s "/bin/true" -G "audio" mpd 1>/dev/null + for dir in /var/{lib,log}/mpd; do + chown -R mpd:mpd "$dir" 1>/dev/null + done +} + +post_remove() { + getent passwd "mpd" &>/dev/null && userdel mpd 1>/dev/null + getent group "mpd" &>/dev/null && groupdel mpd 1>/dev/null + [ -f etc/mpd.conf ] && mv etc/mpd.conf etc/mpd.conf.pacsave 1>/dev/null +} |