Skip to content
Snippets Groups Projects
Commit 4dcb9f9c authored by Dirk Sarpe's avatar Dirk Sarpe
Browse files

Create non existing home directories of users in rgroup.

parents
Branches
No related tags found
No related merge requests found
#!/bin/bash
# script creates home directories for users in rgroup if those do not exist
set -e
rgroup="g_linuxusers"
home="/homes/"
if [ ! -d $home ]
then
mkdir $home
fi
rusers="$(getent group $rgroup | awk -F '[/:]' '{print $4}')"
IFS=',' read -a ruserar <<< "$rusers"
for ruser in "${ruserar[@]}"
do
if [ ! -d $home$ruser ]
then
mkhomedir_helper $ruser 0077 /etc/skel
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment