]> gitweb.pimeys.fr Git - scripts-20-100.git/commitdiff
[populate_forward] À lancer en root pour récupérer le contenu de tous les .forward
authorVincent Le Gallic <legallic@crans.org>
Mon, 7 Apr 2014 22:17:22 +0000 (00:17 +0200)
committerVincent Le Gallic <legallic@crans.org>
Mon, 7 Apr 2014 22:17:22 +0000 (00:17 +0200)
c'est mal

populate_forward.sh [new file with mode: 0755]

diff --git a/populate_forward.sh b/populate_forward.sh
new file mode 100755 (executable)
index 0000000..276a5f3
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# 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
+
+chown legallic:users forwards
+chmod 600 forwards