#!/bin/sh -e

if [ "$1" = "configure" ]; then

if ! grep -q icecast /etc/group; then
# add icecast user and group
groupadd icecast
useradd -d /usr/share/icecast/static -g icecast -s /bin/sh -c "Icecast Server" icecast

# change ownership of directory
chown -R icecast.icecast /usr/share/icecast/
chown -R icecast.icecast /var/log/icecast/
chown -R icecast.icecast /etc/icecast/

fi
fi
