fix: avoid adding user or group that already exist

This commit is contained in:
David Stefan 2017-05-02 22:32:24 +01:00
parent 5350b1319e
commit 653bb44086

View file

@ -5,8 +5,9 @@ OWNER=${OWNER:-nobody}
GROUP=${GROUP:-nogroup}
mkdir -p ${VOLUME}
addgroup ${GROUP}
adduser -D -H -G ${GROUP} ${OWNER}
getent group ${GROUP} > /dev/null || addgroup ${GROUP}
getent passwd ${OWNER} > /dev/null || adduser -D -H -G ${GROUP} ${OWNER}
chown -R ${OWNER}:${GROUP} ${VOLUME}
cat <<EOF > /etc/rsyncd.conf