 	case downloadFailed
 }
 
+var downloadedVersion: String = "<unknown>"
+var availableVersion: String = "<unknown>"
+
 func downloadUpdate(isAuto: Bool = false) throws {
 	let script = "rm -rf update;" +
 		"(git clone -b swift \"git://github.com/SOBotics/FireAlarm.git\" update && " +

		
		let versionContents = try loadFile("available_version.txt").replacingOccurrences(of: "\n", with: " ")
		let components = versionContents.components(separatedBy: " ")
		let availableVersion = components.first ?? ""
		
		if currentVersion != availableVersion {
			return prepareUpdate(listener, rooms, isAuto: auto)
		}
	}

	if process.terminationStatus != 0 {
		throw DownloadFailure.downloadFailed
	} else {
        downloadedVersion = availableVersion

		let downloaded = try loadFile("version-downloaded.txt")
		if isAuto && !downloaded.contains("--autoupdate") {
			throw DownloadFailure.noAutoupdate
