# Remplir le fichier forward
-find /home -mindepth 1 -maxdepth 1 -type d | sort | \
-while read -r dossier;
-do
- if test -f ${dossier}/.forward;
- then
- echo -n "${dossier/\/home\//} : ";
- cat ${dossier}/.forward
- fi
-done > forwards
+USER=legallic
-chown legallic:users forwards
-chmod 600 forwards
+FILE=/home/${USER}/forwards
+
+if [ $EUID -eq 0 ]
+then
+ touch ${FILE}
+ chown ${USER}:users ${FILE}
+ chmod 600 ${FILE}
+
+ find /home -mindepth 1 -maxdepth 1 -type d | sort | \
+ while read -r dossier;
+ do
+ if test -f ${dossier}/.forward;
+ then
+ echo -n "${dossier/\/home\//} : ";
+ cat ${dossier}/.forward
+ fi
+ done > ${FILE}
+
+else
+ echo "À exécuter en root !"
+fi