From 3bf287e3d63bcf35a4315be1e6334814986b38ac Mon Sep 17 00:00:00 2001 From: Camille Lafitte Date: Sat, 31 Dec 2011 16:00:30 +0000 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20des=20traitements=20possibl?= =?UTF-8?q?e=20de=20fixperms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ajout de l'argument -d sous_repertoire Il n'est pas neccessaire d'utiliser -l ou -u sous_repertoire est un chemin relatif de profondeur n Les droits seront corrigés pour l'ensemble des sous repertoires repondant à la contrainte : /var/alternc/html/l/login/sous_repertoire --- src/fixperms.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fixperms.sh b/src/fixperms.sh index 7021c22f..dfe6bc35 100755 --- a/src/fixperms.sh +++ b/src/fixperms.sh @@ -31,11 +31,12 @@ #Default Query : fixperms for all account query="SELECT uid,login FROM membres" +sub_dir="" #Two optionals argument # -l string : a specific login to fix # -u interger : a specifi uid to fix -while getopts "l:u:" optname +while getopts "l:u:d:" optname do case "$optname" in "l") @@ -44,6 +45,9 @@ while getopts "l:u:" optname "u") query="SELECT uid,login FROM membres WHERE uid LIKE '$OPTARG'" ;; + "d") + sub_dir="$OPTARG" + ;; "?") echo "Unknown option $OPTARG - stop processing" exit @@ -85,7 +89,7 @@ doone() { echo "Setting rights and ownership for user $LOGIN having gid $GID" fi INITIALE=`echo $LOGIN |cut -c1` - REP="$ALTERNC_LOC/html/$INITIALE/$LOGIN" + REP="$ALTERNC_LOC/html/$INITIALE/$LOGIN/$sub_dir" # Set the file readable only for the AlternC User chown -R $GID:$GID "$REP"