#!/bin/bash

# –––––––––
# PARAMETRI
# –––––––––
# 1 - username
# 2 - password
# 3 - home folder
# 4 - read only

usermod -d $3 $1

echo "$2" | passwd --stdin $1

if [ "$4" == "1" ] || [ "$4" == "true" ]
then
	setfacl -R -m u:$1:rx $3
else
	setfacl -R -m u:$1:rwx $3
fi
