Skip to content

Commit d076614

Browse files
authored
Merge pull request #72 from jamf/version-2.3
updates for version 2.3
2 parents 1860716 + 9606aa2 commit d076614

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

aftermath/Aftermath.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@ class Aftermath {
1515
static func shell(_ command: String) -> String {
1616
let task = Process()
1717
let pipe = Pipe()
18-
18+
1919
task.standardOutput = pipe
2020
task.standardError = pipe
2121
task.arguments = ["-c", command]
2222
task.launchPath = "/bin/bash"
2323
task.launch()
24-
24+
25+
let timerSource = DispatchSource.makeTimerSource()
26+
timerSource.setEventHandler {
27+
task.terminate()
28+
}
29+
timerSource.schedule(wallDeadline: .now() + 30)
30+
timerSource.resume()
31+
2532
let data = pipe.fileHandleForReading.readDataToEndOfFile()
2633
let output = String(data: data, encoding: .utf8)!
2734

aftermath/Command.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Command {
2828
static var collectDirs: [String] = []
2929
static var unifiedLogsFile: String? = nil
3030
static var esLogs: [String] = ["create", "exec", "mmap"]
31-
static let version: String = "2.2.2"
31+
static let version: String = "2.3.0"
3232
static var disableFeatures: [String:Bool] = ["all": false, "browsers": false, "browser-killswitch": false, "databases": false, "filesystem": false, "proc-info": false, "slack": false, "ul": false]
3333

3434
static func main() {

endpointSecurity/ESLogs.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ class ESLogs: ESModule {
2121
func logESEvents(events: String) {
2222
var output = ""
2323
DispatchQueue.global(qos: .userInitiated).async { [weak self] in
24-
let command = "eslogger \(events) > \(self!.outputFile.relativePath)"
24+
25+
let command = "eslogger \(events) > \(self?.outputFile.relativePath)"
2526
output = Aftermath.shell("\(command)")
2627

2728
return
2829
}
29-
30+
3031
self.addTextToFile(atUrl: self.outputFile, text: output)
3132
}
3233

0 commit comments

Comments
 (0)