調整console訊息

This commit is contained in:
Raymond Yang 2023-08-12 13:31:59 +08:00
parent cac3e9487b
commit c249c9a2ce

View File

@ -12,6 +12,7 @@ import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.io.File
import java.io.IOException
import kotlin.system.exitProcess
private lateinit var config: Configure
@ -104,24 +105,31 @@ fun main() {
val updateDnsResult = apiService.updateZoneDnsRecords("Bearer $token", zoneId, recordId, updateDnsBody)
if (updateDnsResult.success) {
println("更新 DDNS 成功")
exitProcess(0)
} else {
println("更新 DDNS 失敗")
exitProcess(0)
}
} else {
println("無法取得域名資料資料")
exitProcess(0)
}
} else {
println("無法取得 Zone 資料")
exitProcess(0)
}
} else {
println("CF 權杖無效")
exitProcess(0)
}
} catch (e: Exception) {
e.printStackTrace()
println("Error: ${e.message}")
exitProcess(0)
}
} else {
println("Error retrieving IP address")
println("無法取得 WAN IP 位址...")
exitProcess(0)
}
}
}