浏览代码

addond: give proper permission after restoring files

TheScarastic 6 年之前
父节点
当前提交
7358671703
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      addond_tail

+ 11 - 1
addond_tail

@@ -24,6 +24,16 @@ case "$1" in
     # Stub
   ;;
   post-restore)
-    # Stub
+   if [ -d "/postinstall" ]; then
+      P="/postinstall/system"
+   else
+      P="/system"
+    fi
+
+    for i in $(list_files); do
+      chown root:root "$P/$i"
+      chmod 644 "$P/$i"
+      chmod 755 "$(dirname "$P/$i")"
+    done
   ;;
 esac