You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val portalAddress:String by option("-z", "--portal").help("Login Portal URL. For example http://172.26.8.11").default("http://172.26.8.11")
31
-
privateval ip:String? by option("-a", "--ip").help("Outbound IP").help("Your outbound IP address. Leave blank for auto detect.")
32
+
val portalAddress:String by option("-z", "--portal").help("Login Portal URL. For example http://172.26.8.11")
33
+
.default("http://172.26.8.11")
34
+
privateval ip:String? by option("-a", "--ip").help("Outbound IP")
35
+
.help("Your outbound IP address. Leave blank for auto detect.")
32
36
33
37
val accountId:String by option("-u", "--username").prompt("Account ID").help("Account ID")
34
38
val accountPassword:String by option("-p", "--password").prompt("Password").help("Password")
35
-
val networkInterface:String? by option("-i", "--interface").help("Network Interface Name. All traffic will be sent through this interface if specified.").convert { it.trim() }
36
-
val waitInterface:Int by option().int().help("Wait Network Interface if it is currently unavailable every N seconds. Default 0 for disabled.").default(0)
39
+
val networkInterface:String? by option(
40
+
"-i",
41
+
"--interface"
42
+
).help("Network Interface Name. All traffic will be sent through this interface if specified.")
43
+
.convert { it.trim() }
44
+
val waitInterface:Int by option().int()
45
+
.help("Wait Network Interface if it is currently unavailable every N seconds. Default 0 for disabled.")
46
+
.default(0)
37
47
38
48
val logout:Boolean by option().boolean().default(false)
39
-
val checkAlive:Int by option("-c", "--check-alive").int().help("Check whether network is still alive every N seconds. 0 for disabled.").default(0)
40
-
val keepAlive:Int by option().int().help("Send heart packet to keep alive every N seconds. 0 for disabled.").default(0)
49
+
val checkAlive:Int by option("-c", "--check-alive").int()
50
+
.help("Check whether network is still alive every N seconds. 0 for disabled.").default(0)
51
+
val keepAlive:Int by option().int().help("Send heart packet to keep alive every N seconds. 0 for disabled.")
52
+
.default(0)
41
53
val isRetry:Int by option("--retry").int().help("Retry every N seconds if failed. 0 for disabled.").default(10)
42
54
val retryWaitTime:Int by option("-r", "--retry-wait-time").int().help("Retry wait time in N seconds").default(2)
43
-
val logLevel:Level by option("-l", "--log-level").convert { Level.parse(it) }.help("Log Level. FINEST < FINER < FINE < CONFIG < INFO < WARNING < SEVERE").default(Level.INFO)
55
+
val logLevel:Level by option("-l", "--log-level").convert { Level.parse(it) }
56
+
.help("Log Level. FINEST < FINER < FINE < CONFIG < INFO < WARNING < SEVERE").default(Level.INFO)
57
+
58
+
val onlineHandler:String? by option().help("Execute command when network online. For example: /usr/bin/notify-send 'Network is online'")
59
+
val waitOnlineHandler:Boolean by option().boolean().default(false)
60
+
// val offlineHandler: String? by option().help("Execute command when network offline. For example: /usr/bin/notify-send 'Network is offline'")
val request = createRequestBuilderWithCommonHeaders("${portalAddress}/cgi-bin/srun_portal?callback=jQuery112405095399744250795_$time&action=logout&username=$accountId&ip=$outboundIp&ac_id=1&_=$time")
val request = createRequestBuilderWithCommonHeaders("$portalAddress/cgi-bin/rad_user_info?callback=jQuery112406390292035501186_$timestamp&_=$timestamp")
0 commit comments