Browse Source

Merge "(perm) Fix CL for reverting missing file"

Zuul 1 month ago
parent
commit
3bce1c1ac2
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      divingbell/templates/bin/_perm.sh.tpl

+ 6
- 3
divingbell/templates/bin/_perm.sh.tpl View File

@@ -97,11 +97,14 @@ revert_perm(){
97 97
     for o_perm in ${revert_list}; do
98 98
       first=1
99 99
       while IFS=' ' read -r a1 a2; do
100
-        if [ "$first" -eq 1 ]; then
101
-          $(chmod $a1 $a2)
100
+        if [ "$first" -eq 1 && -e "$a2"]; then
101
+          $(chmod "$a1" "$a2")
102 102
           first=0
103
+        elif [ -e "$a2"]; then
104
+          $(chown "$a1" "$a2")
103 105
         else
104
-          $(chown $a1 $a2)
106
+          log.WARN "Unable to revert permissions on $a2"
107
+          continue
105 108
         fi
106 109
       done < "${backup_path}/${o_perm}"
107 110
 

Loading…
Cancel
Save