調整console訊息
This commit is contained in:
parent
cac3e9487b
commit
c249c9a2ce
@ -12,6 +12,7 @@ import retrofit2.Retrofit
|
|||||||
import retrofit2.converter.gson.GsonConverterFactory
|
import retrofit2.converter.gson.GsonConverterFactory
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import kotlin.system.exitProcess
|
||||||
|
|
||||||
|
|
||||||
private lateinit var config: Configure
|
private lateinit var config: Configure
|
||||||
@ -104,24 +105,31 @@ fun main() {
|
|||||||
val updateDnsResult = apiService.updateZoneDnsRecords("Bearer $token", zoneId, recordId, updateDnsBody)
|
val updateDnsResult = apiService.updateZoneDnsRecords("Bearer $token", zoneId, recordId, updateDnsBody)
|
||||||
if (updateDnsResult.success) {
|
if (updateDnsResult.success) {
|
||||||
println("更新 DDNS 成功")
|
println("更新 DDNS 成功")
|
||||||
|
exitProcess(0)
|
||||||
} else {
|
} else {
|
||||||
println("更新 DDNS 失敗")
|
println("更新 DDNS 失敗")
|
||||||
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println("無法取得域名資料資料")
|
println("無法取得域名資料資料")
|
||||||
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println("無法取得 Zone 資料")
|
println("無法取得 Zone 資料")
|
||||||
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println("CF 權杖無效")
|
println("CF 權杖無效")
|
||||||
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
println("Error: ${e.message}")
|
println("Error: ${e.message}")
|
||||||
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println("Error retrieving IP address")
|
println("無法取得 WAN IP 位址...")
|
||||||
|
exitProcess(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user