jean-cloud-services/provisioning/roles/deploy_all/files/bin/init.sh
2023-12-20 18:06:09 +01:00

14 lines
341 B
Bash
Executable File

#!/bin/bash
while IFS=';' read -r uid username service server
do
home="/data/$service"
if [ -z "$(grep "^$username:" /etc/passwd)" ] ; then
useradd -m -U -r -d "$home" "$username"
fi
# Do not touch the group, it can be set to something useful
chown "$username" "$home"
chmod 770 "$home"
done < <(grep -v '^#' /docker/services.csv)