-
Notifications
You must be signed in to change notification settings - Fork 27
/
runModeClean.go
43 lines (40 loc) · 1.12 KB
/
runModeClean.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"log"
)
// 清理旧分流规则
func clean() {
iKuai, err := loginToIkuai()
if err != nil {
log.Println("登录爱快失败:", err)
return
}
//删除旧的自定义运营商
err = iKuai.DelCustomIspAll(*cleanTag)
if err != nil {
log.Println("移除旧的自定义运营商失败 tag:"+*cleanTag+":", err)
} else {
log.Println("移除旧的自定义运营商成功 tag:" + *cleanTag)
}
//删除旧的域名分流
err = iKuai.DelStreamDomainAll(*cleanTag)
if err != nil {
log.Println("移除旧的域名分流失败 tag:"+*cleanTag+":", err)
} else {
log.Println("移除旧的域名分流成功 tag:" + *cleanTag)
}
//删除旧的ip组
err = iKuai.DelIKuaiBypassIpGroup(*cleanTag)
if err != nil {
log.Println("移除旧的IP分组失败 tag:"+*cleanTag+":", err)
} else {
log.Println("移除旧的IP分组成功 tag:" + *cleanTag)
}
//删除端口分流规则
err = iKuai.DelIKuaiBypassStreamIpPort(*cleanTag)
if err != nil {
log.Println("移除旧的端口分流失败 tag:"+*cleanTag+":", err)
} else {
log.Println("移除旧的端口分流成功 tag:" + *cleanTag)
}
}