Skip to content

Commit

Permalink
Remove more xina files
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Apr 11, 2023
1 parent d354306 commit c88afa0
Showing 1 changed file with 47 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,47 +79,54 @@ class Bootstrapper {

// If xina was used before, clean the mess it creates in /var
// Xina will recreate them on the next jb through it so there is no loss here
let xinaInstalled = FileManager.default.fileExists(atPath: "/var/LIY")
if xinaInstalled {
let xinaVarSymlinks = [
"alternatives",
"ap",
"apt",
"bin",
"bzip2",
"cache",
"dpkg",
"etc",
"gzip",
"lib",
"Lib",
"libexec",
"Library",
"LIY",
"Liy",
"local",
"newuser",
"profile",
"sbin",
"suid_profile",
"sh",
"sy",
"share",
"ssh",
"sudo_logsrvd.conf",
"suid_profile",
"sy",
"usr",
"zlogin",
"zlogout",
"zprofile",
"zshenv",
"zshrc"
]
let xinaLeftoverSymlinks = [
"/var/alternatives",
"/var/ap",
"/var/apt",
"/var/bin",
"/var/bzip2",
"/var/cache",
"/var/dpkg",
"/var/etc",
"/var/gzip",
"/var/lib",
"/var/Lib",
"/var/libexec",
"/var/Library",
"/var/LIY",
"/var/Liy",
"/var/local",
"/var/newuser",
"/var/profile",
"/var/sbin",
"/var/suid_profile",
"/var/sh",
"/var/sy",
"/var/share",
"/var/ssh",
"/var/sudo_logsrvd.conf",
"/var/suid_profile",
"/var/sy",
"/var/usr",
"/var/zlogin",
"/var/zlogout",
"/var/zprofile",
"/var/zshenv",
"/var/zshrc",
"/var/log/dpkg",
"/var/log/apt"
]
let xinaLeftoverFiles = [
"/var/lib", //sometimes is a symlink, sometimes is not(?)
"/var/master.passwd"
]

for xinaVarSymlink in xinaVarSymlinks {
let symlinkPathToWipe = "/var/" + xinaVarSymlink
try wipeSymlink(atPath: symlinkPathToWipe)
for xinaLeftoverSymlink in xinaLeftoverSymlinks {
try wipeSymlink(atPath: xinaLeftoverSymlink)
}
for xinaLeftoverFile in xinaLeftoverFiles {
if FileManager.default.fileExists(atPath: xinaLeftoverFile) {
try FileManager.default.removeItem(atPath: xinaLeftoverFile)
}
}

Expand Down

0 comments on commit c88afa0

Please sign in to comment.