# Remplir le fichier forward
-USER=legallic
-
-FILE=/home/${USER}/forwards
if [ $EUID -eq 0 ]
then
+ USER=${SUDO_USER}
+ HOMEDIR=$(getent passwd ${USER} | cut -d ":" -f 6)
+ FILE=${HOMEDIR}/forwards
+
touch ${FILE}
chown ${USER}:users ${FILE}
chmod 600 ${FILE}
- find /home -mindepth 1 -maxdepth 1 -type d | sort | \
+ find /home -mindepth 2 -maxdepth 2 -type d | sort | \
while read -r dossier;
do
if test -f ${dossier}/.forward;