jean-cloud-services/provisioning/roles/deploy_all/files/bin/init.sh

14 lines
341 B
Bash
Raw Normal View History

2023-12-20 17:06:09 +00:00
#!/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)