Browse Source

reprends les droits du répertoire pour les réappliquer sur le point de montage

develop
Emmanuel Garette 5 months ago
parent
commit
77244e1591
1 changed files with 10 additions and 9 deletions
  1. 10
    9
      scripts/glusterfs_init

+ 10
- 9
scripts/glusterfs_init View File

@@ -40,16 +40,17 @@ if [ -f /etc/eole/config.eol ]; then
40 40
         destdir=$(CreoleGet glusterfs_dirname)
41 41
         mkdir -p $destdir
42 42
         echo "$hostname:/$glusterfs_name $destdir glusterfs backupvolfile-server=$all_server,defaults,_netdev 0 0" >> /etc/fstab
43
-	mv "$destdir" "${destdir%/}.old"
44
-	mkdir "$destdir"
43
+        old_dir="${destdir%/}.old"
44
+        mv "$destdir" "$old_dir"
45
+        mkdir "$destdir"
45 46
         mount -a
46
-	mv "${destdir%/}.old"/* "$destdir/"
47
-	rmdir "${destdir%/}.old"
48
-## FIX droits sur le destdir
49
-	user=$(CreoleGet virt_user)
50
-	group=$(CreoleGet virt_group)
51
-	chmod -R 755 $destdir
52
-	chown -R $user:$group $destdir
47
+        mv "$old_dir"/* "$destdir/"
48
+        user=$(stat -c "%U" "$old_dir")
49
+        group=$(stat -c "%G" "$old_dir")
50
+        right=$(stat -c "%a" "$old_dir")
51
+        chmod $right $destdir
52
+        chown $user:$group $destdir
53
+        rmdir "$old_dir"
53 54
     fi
54 55
 else
55 56
     echo "Le serveur n'est pas configuré, config.eol inexistant"

Loading…
Cancel
Save