Try to remove immutable flag from any file before mass deletion
This commit is contained in:
parent
0d8a64eb96
commit
753e0297f7
1 changed files with 5 additions and 0 deletions
5
vps2arch
5
vps2arch
|
@ -88,6 +88,11 @@ save_root_pass() {
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_all() {
|
delete_all() {
|
||||||
|
# Remove immutable flag from any files / directories
|
||||||
|
if command -v chattr >/dev/null 2>&1; then
|
||||||
|
find / -type f \( ! -path '/dev/*' -and ! -path '/proc/*' -and ! -path '/sys/*' -and ! -path '/selinux/*' -and ! -path "/root.$cpu_type/*" \) \
|
||||||
|
-exec chattr -i {} + 2>/dev/null || true
|
||||||
|
fi
|
||||||
# Delete *all* files from /
|
# Delete *all* files from /
|
||||||
find / \( ! -path '/dev/*' -and ! -path '/proc/*' -and ! -path '/sys/*' -and ! -path '/selinux/*' -and ! -path "/root.$cpu_type/*" \) -delete 2>/dev/null || true
|
find / \( ! -path '/dev/*' -and ! -path '/proc/*' -and ! -path '/sys/*' -and ! -path '/selinux/*' -and ! -path "/root.$cpu_type/*" \) -delete 2>/dev/null || true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue