Skip to content
This repository was archived by the owner on Aug 29, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ log_error_exit() {
if [ "$UNISON_USER" != "root" ]; then
log_heading "Setting up non-root user ${UNISON_USER}."
HOME="/home/${UNISON_USER}"
addgroup -g $UNISON_GID -S $UNISON_GROUP
adduser -u $UNISON_UID -D -S -G $UNISON_GROUP $UNISON_USER

if [ ! $(getent group ${UNISON_GROUP}) ]; then
log_info "Creating group ${UNISON_GROUP}"
addgroup -g $UNISON_GID -S $UNISON_GROUP
fi

if [ ! $(getent passwd ${UNISON_USER}) ]; then
log_info "Creating user ${UNISON_USER}"
adduser -u $UNISON_UID -D -S -G $UNISON_GROUP $UNISON_USER
fi

mkdir -p ${HOME}/.unison
chown -R ${UNISON_USER}:${UNISON_GROUP} ${HOME}
fi
Expand Down