├── README.md ├── media ├── Netflix_Domain ├── Netflix_IP ├── EmbyUnlock.sh └── DisneyPlus_Domain ├── ios-rule ├── QuantumultX_Config.conf ├── Loon_Config.conf └── Shadowrocket_Config.conf └── ss └── ss-rust.sh /README.md: -------------------------------------------------------------------------------- 1 | 存放本人使用的app相关规则,需要的,请自取。 2 | 3 | 如果修改文件,请备注原作者,谢谢。 4 | -------------------------------------------------------------------------------- /media/Netflix_Domain: -------------------------------------------------------------------------------- 1 | # Domain 2 | netflix.com 3 | netflix.net 4 | netflix.ca 5 | netflixinvestor.com 6 | netflixtechblog.com 7 | nflxext.com 8 | nflximg.com 9 | nflximg.net 10 | nflxsearch.net 11 | nflxso.net 12 | nflxvideo.net 13 | fast.com 14 | amazonaws.com 15 | aws.amazon.com 16 | awsstatic.com 17 | 18 | 19 | # DNS test 20 | netflixdnstest1.com 21 | netflixdnstest2.com 22 | netflixdnstest3.com 23 | netflixdnstest4.com 24 | netflixdnstest5.com 25 | netflixdnstest6.com 26 | netflixdnstest7.com 27 | netflixdnstest8.com 28 | netflixdnstest9.com 29 | netflixdnstest10.com 30 | -------------------------------------------------------------------------------- /media/Netflix_IP: -------------------------------------------------------------------------------- 1 | 23.246.0.0/16 2 | 37.77.184.0/21 3 | 45.57.0.0/17 4 | 64.120.128.0/17 5 | 66.197.128.0/17 6 | 69.53.224.0/19 7 | 108.175.32.0/20 8 | 185.2.220.0/22 9 | 185.9.188.0/22 10 | 192.173.64.0/18 11 | 198.38.96.0/19 12 | 198.45.48.0/20 13 | 208.75.76.0/22 14 | 3.0.0.0/8 15 | 13.24.0.0/13 16 | 13.32.0.0/12 17 | 13.244.0.0/14 18 | 13.248.0.0/14 19 | 15.177.0.0/16 20 | 15.181.0.0/16 21 | 15.193.0.0/16 22 | 15.220.0.0/16 23 | 15.221.0.0/16 24 | 15.230.0.0/16 25 | 15.251.0.0/16 26 | 16.182.0.0/16 27 | 18.34.0.0/16 28 | 18.88.0.0/18 29 | 18.89.128.0/18 30 | 18.204.0.0/14 31 | 18.208.0.0/13 32 | 18.232.0.0/14 33 | 23.20.0.0/14 34 | 34.192.0.0/12 35 | 34.224.0.0/12 36 | 35.71.68.0/22 37 | 35.153.0.0/16 38 | 35.168.0.0/13 39 | 44.192.0.0/11 40 | 46.51.208.0/22 41 | 50.16.0.0/15 42 | 50.19.0.0/16 43 | 52.0.0.0/8 44 | 54.0.0.0/8 45 | 63.246.119.0/24 46 | 64.187.128.0/20 47 | 64.252.0.0/16 48 | 67.202.0.0/18 49 | 67.220.240.0/20 50 | 68.66.112.0/20 51 | 69.107.0.0/18 52 | 70.232.92.0/22 53 | 72.21.192.0/19 54 | 72.41.0.0/16 55 | 72.44.0.0/16 56 | 75.101.128.0/17 57 | 76.223.172.0/22 58 | 96.0.0.0/9 59 | 99.0.0.0/8 60 | 100.24.0.0/13 61 | 107.20.0.0/14 62 | 136.18.50.0/23 63 | 142.4.160.0/19 64 | 150.222.0.0/16 65 | 151.148.0.0/16 66 | 161.178.0.0/16 67 | 161.193.0.0/16 68 | 162.250.236.0/22 69 | 172.96.96.0/20 70 | 174.129.0.0/16 71 | 176.32.0.0/16 72 | 184.72.0.0/16 73 | 184.73.0.0/16 74 | 192.26.25.0/24 75 | 192.43.175.0/24 76 | 199.127.232.0/22 77 | 204.45.0.0/16 78 | 204.236.192.0/18 79 | 205.251.192.0/18 80 | 207.171.160.0/19 81 | 208.86.88.0/23 82 | 208.110.48.0/20 83 | 209.54.176.0/21 84 | 216.182.224.0/20 85 | 2607:fb10::/32 86 | 2a00:86c0::/32 87 | 2a03:5640::/32 88 | 2600:1F00::/24 89 | 2600:F000::/24 90 | 2605:9CC0::/32 91 | 2606:F40::/32 92 | 2620:107::/32 93 | -------------------------------------------------------------------------------- /media/EmbyUnlock.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ `uname -a` =~ "Darwin" ]];then 4 | echo -e "\033[33m开始检测是否已安装 Emby 客户端...\033[0m" 5 | else 6 | echo -e "\033[31m非 MacOS 系统,不能使用此脚本解锁 Emby 播放权限\033[0m" 7 | exit 0 8 | fi 9 | 10 | EmbyApp="/Applications/Emby.app" 11 | ConnectionManagerFile="${EmbyApp}/Contents/Resources/www/modules/emby-apiclient/connectionmanager.js" 12 | 13 | if [ ! -f "$ConnectionManagerFile" ]; then 14 | echo -e "\033[31m请先从 https://itunes.apple.com/us/app/emby/id992180193?ls=1&mt=8 安装 Emby 客户端,然后再运行本解锁程序\033[0m" 15 | exit 0 16 | fi 17 | 18 | echo "已安装 Emby 客户端,准备解锁 Emby 播放权限" 19 | 20 | reject='var status=(response||{}).status;return console.log("getRegistrationInfo response: "+status),403===status?Promise.reject("overlimit"):status&&status<500?Promise.reject():function(err){if(console.log("getRegistrationInfo failed: "+err),regCacheValid)return console.log("getRegistrationInfo returning cached info"),Promise.resolve();throw err}(response)' 21 | 22 | embyVersion=`cat /Applications/Emby.app/Contents/Info.plist | grep -A1 CFBundleShortVersionString | grep string | sed 's/<[^>]*>//g' | sed 's/\t//g'` 23 | 24 | if [ "$embyVersion" > '2.1.99' ]; then 25 | echo -e "当前 Emby 版本大于2.2.0,使用新代码匹配" 26 | reject='var status=(response||{}).status;if(console.log("getRegistrationInfo response: "+status),status&&status<500&&appStorage.setItem(cacheKey,JSON.stringify({lastValidDate:-1,deviceId:params.deviceId,cacheExpirationDays:0,lastUpdated:Date.now()})),403===status)return Promise.reject("overlimit");if(status&&status<500)return Promise.reject();status=response;if(console.log("getRegistrationInfo failed: "+status),regCacheValid)return console.log("getRegistrationInfo returning cached info"),Promise.resolve();throw status' 27 | fi 28 | 29 | resolve='return appStorage.setItem(cacheKey,JSON.stringify({lastValidDate:Date.now(),deviceId:params.deviceId,cacheExpirationDays:999})),Promise.resolve()' 30 | 31 | sudo sed -i "" "s/$reject/$resolve/" $ConnectionManagerFile 32 | 33 | echo -e "\033[32mEmby 播放权限解锁成功\033[0m" 34 | 35 | pid=`ps -ef|grep ${EmbyApp}|grep -v grep|awk '{print $2}'` 36 | if [ ! -z $pid ]; then 37 | echo -e "\033[32m正在重启 Emby 客户端\033[0m" 38 | kill -9 $pid 39 | else 40 | echo -e "\033[32m正在启动 Emby 客户端\033[0m" 41 | fi 42 | open $EmbyApp 43 | 44 | exit 0 45 | -------------------------------------------------------------------------------- /media/DisneyPlus_Domain: -------------------------------------------------------------------------------- 1 | 20thcenturystudios.com.au 2 | 20thcenturystudios.com.br 3 | 20thcenturystudios.jp 4 | abc-studios.com 5 | abc.com 6 | abcnews.com 7 | abcnews.edgesuite.net 8 | adobedtm.com 9 | adventuresbydisney.com 10 | babble.com 11 | babyzone.com 12 | bam.nr-data.net 13 | bamgrid.com 14 | beautyandthebeastmusical.co.uk 15 | braze.com 16 | cdn.optimizely.com 17 | conviva.com 18 | d9.flashtalking.com 19 | dilcdn.com 20 | disney-asia.com 21 | disney-discount.com 22 | disney-plus.net 23 | disney-portal.my.onetrust.com 24 | disney-studio.com 25 | disney-studio.net 26 | disney.asia 27 | disney.be 28 | disney.bg 29 | disney.ca 30 | disney.ch 31 | disney.co.il 32 | disney.co.jp 33 | disney.co.kr 34 | disney.co.th 35 | disney.co.uk 36 | disney.co.za 37 | disney.com 38 | disney.com.au 39 | disney.com.br 40 | disney.com.hk 41 | disney.com.tw 42 | disney.cz 43 | disney.de 44 | disney.demdex.net 45 | disney.dk 46 | disney.es 47 | disney.fi 48 | disney.fr 49 | disney.gr 50 | disney.hu 51 | disney.id 52 | disney.in 53 | disney.io 54 | disney.it 55 | disney.my 56 | disney.my.sentry.io 57 | disney.nl 58 | disney.no 59 | disney.ph 60 | disney.pl 61 | disney.pt 62 | disney.ro 63 | disney.ru 64 | disney.se 65 | disney.sg 66 | disneyadsales.com 67 | disneyarena.com 68 | disneyaulani.com 69 | disneybaby.com 70 | disneycareers.com 71 | disneychannelonstage.com 72 | disneychannelroadtrip.com 73 | disneycruisebrasil.com 74 | disneyenconcert.com 75 | disneyiejobs.com 76 | disneyinflight.com 77 | disneyinternational.com 78 | disneyinternationalhd.com 79 | disneyjunior.com 80 | disneyjuniortreataday.com 81 | disneylandparis.com 82 | disneylatino.com 83 | disneymagicmoments.co.il 84 | disneymagicmoments.co.uk 85 | disneymagicmoments.co.za 86 | disneymagicmoments.de 87 | disneymagicmoments.es 88 | disneymagicmoments.fr 89 | disneymagicmoments.gen.tr 90 | disneymagicmoments.gr 91 | disneymagicmoments.it 92 | disneymagicmoments.pl 93 | disneymagicmomentsme.com 94 | disneyme.com 95 | disneymeetingsandevents.com 96 | disneymovieinsiders.com 97 | disneymusicpromotion.com 98 | disneynewseries.com 99 | disneynow.com 100 | disneypeoplesurveys.com 101 | disneyplus.bn5x.net 102 | disneyplus.com 103 | disneyplus.com.ssl.sc.omtrdc.net 104 | disneyprivacycenter.com 105 | disneyredirects.com 106 | disneysrivieraresort.com 107 | disneystore.com 108 | disneystreaming.com 109 | disneysubscription.com 110 | disneytermsofuse.com 111 | disneytickets.co.uk 112 | disneyturkiye.com.tr 113 | disneytvajobs.com 114 | disneyworld-go.com 115 | dlp-media.com 116 | dmed.technology 117 | dssott.com 118 | dtci.co 119 | dtci.technology 120 | edgedatg.com 121 | espn.co.uk 122 | espn.com 123 | espn.hb.omtrdc.net 124 | espn.net 125 | espncdn.com 126 | espndotcom.tt.omtrdc.net 127 | espnqa.com 128 | execute-api.us-east-1.amazonaws.com 129 | go-disneyworldgo.com 130 | go.com 131 | hotstar-cdn.net 132 | hotstar-labs.com 133 | hotstar.com 134 | hotstarext.com 135 | hsprepack.akamaized.net 136 | js-agent.newrelic.com 137 | marvel.com 138 | marvel10thanniversary.com 139 | marveldimensionofheroes.com 140 | marvelparty.net 141 | marvelpinball.com 142 | marvelsdoubleagent.com 143 | marvelspotlightplays.com 144 | marvelsuperheroseptember.com 145 | marvelsuperwar.com 146 | mickey.tv 147 | moviesanywhere.com 148 | natgeomaps.com 149 | nationalgeographic.com 150 | nationalgeographicpartners.com 151 | ngeo.com 152 | nomadlandmovie.ch 153 | playmation.com 154 | shopdisney.com 155 | shops-disney.com 156 | sorcerersarena.com 157 | spaindisney.com 158 | star-brasil.com 159 | star-latam.com 160 | starott.com 161 | starplus.com 162 | starwars.com 163 | starwarsgalacticstarcruiser.com 164 | starwarskids.com 165 | streamingdisney.net 166 | themarvelexperiencetour.com 167 | thestationbymaker.com 168 | thewaltdisneycompany.com 169 | thisispolaris.com 170 | watchdisneyfe.com 171 | watchespn.com 172 | com.disney.datg.videoplatforms.android.abc 173 | com.disney.disneyplus 174 | -------------------------------------------------------------------------------- /ios-rule/QuantumultX_Config.conf: -------------------------------------------------------------------------------- 1 | # QuantumultX 懒人配置 2 | # Date: 2025-12-16 13:39 3 | # Author: https://github.com/lingchenzi/ 4 | # URL: https://github.com/lingchenzi/app/blob/main/ios-rule/QuantumultX_Config.conf 5 | # 国内默认直连,国外走代理,手动选节点 6 | 7 | [general] 8 | # 直连网络测试URL 9 | network_check_url = http://www.apple.com/library/test/success.html 10 | # 节点延迟测试URL 11 | server_check_url=http://www.gstatic.com/generate_204 12 | # 资源解析器 13 | resource_parser_url=https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/resource-parser.js 14 | # 节点信息 15 | geo_location_checker=http://ip-api.com/json/?lang=zh-CN, https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/IP_API.js 16 | # 不使用fake-ip 及远程解析域名列表 17 | dns_exclusion_list=*.cmpassport.com, *.jegotrip.com.cn, *.icitymobile.mobi, id6.me, *.pingan.com.cn, *.cmbchina.com 18 | # 绕过QuantumultX代理 19 | excluded_routes=239.255.255.250/32 20 | # fallback配置 21 | fallback_udp_policy = reject 22 | # UDP白名单端口列表 23 | udp_drop_list = 443 24 | # icmp 配置 25 | icmp_auto_reply = true 26 | 27 | [dns] 28 | # 禁用系统DNS 29 | no-system 30 | # 启用IPV6 31 | ;no-ipv6 32 | # 优先使用DoH3 33 | prefer-doh3 34 | # dns server 35 | server=223.5.5.5 36 | server=119.29.29.29 37 | # doh server 38 | doh-server=https://dns.alidns.com/dns-query,https://doh.pub/dns-query 39 | 40 | [policy] 41 | # 策略组 42 | static=China, direct, img-url=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/icon/color/cn.png 43 | static=Global, proxy, img-url=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/icon/color/global.png 44 | 45 | [server_remote] 46 | # 服务器订阅 47 | 48 | [filter_remote] 49 | # 分流规则 50 | # China 51 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/QuantumultX/China/China.list, tag=China, force-policy=China, update-interval=86400, opt-parser=true, enabled=true 52 | # ChinaIPs 53 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/QuantumultX/ChinaIPs/ChinaIPs.list, tag=ChinaIPs, force-policy=China, update-interval=86400, opt-parser=true, enabled=true 54 | # ChinaMedia 55 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/QuantumultX/ChinaMedia/ChinaMedia.list, tag=ChinaMedia, force-policy=China, update-interval=86400, opt-parser=true, enabled=true 56 | # Global 57 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/QuantumultX/Global/Global.list, tag=Global, force-policy=Global, update-interval=86400, enabled=true 58 | # GlobalMedia 59 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/QuantumultX/GlobalMedia/GlobalMedia.list, tag=GlobalMedia, force-policy=Global, update-interval=86400, opt-parser=true, enabled=true 60 | 61 | [rewrite_remote] 62 | # 复写规则 63 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rewrite/QuantumultX/Redirect/Redirect.conf, tag=Redirect, update-interval=86400, opt-parser=false, enabled=true 64 | 65 | [server_local] 66 | # 本地服务器 67 | 68 | [filter_local] 69 | # Local Area Network 局域网 70 | iip6-cidr,fe80.0/8,DIRECT 71 | ip-cidr,100.64.0.0/10,DIRECT 72 | ip-cidr,127.0.0.0/8,DIRECT 73 | ip-cidr,172.16.0.0/12,DIRECT 74 | ip-cidr,192.0.0.0/24,DIRECT 75 | ip-cidr,192.168.0.0/16,DIRECT 76 | ip-cidr,198.18.0.0/15,DIRECT 77 | ip-cidr,224.0.0.0/4,DIRECT 78 | 79 | # IPv6 局域网 80 | ip6-cidr,::1/128,DIRECT 81 | ip6-cidr,fc00::/7,DIRECT 82 | ip6-cidr,fe80::/10,DIRECT 83 | 84 | # bing 85 | DOMAIN-SUFFIX,bing.com,PROXY 86 | 87 | # 启用China订阅规则需要注释GeoIP 88 | # https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-Country.mmdb 89 | # https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb 90 | ;geoip, cn, direct 91 | # 兜底规则 92 | final, Global 93 | 94 | [rewrite_local] 95 | # 本地复写规则 96 | 97 | [task_local] 98 | # 本地脚本 99 | # 流媒体解锁查询 100 | event-interaction https://raw.githubusercontent.com/KOP-XIAO/QuantumultX/master/Scripts/streaming-ui-check.js, tag=流媒体解锁查询, img-url=arrowtriangle.right.square.system, enabled=true 101 | # 网络信息查询 102 | event-interaction https://raw.githubusercontent.com/xream/scripts/main/surge/modules/network-info/net-lsp-x.js, tag=网络信息查询, img-url=link.circle.system, enabled=true 103 | 104 | [http_backend] 105 | # 本地HTTP服务器 106 | 107 | [mitm] 108 | passphrase = 109 | p12 = 110 | hostname = 111 | skip_validating_cert = true 112 | -------------------------------------------------------------------------------- /ios-rule/Loon_Config.conf: -------------------------------------------------------------------------------- 1 | # Loon 懒人配置 2 | # Date: 2025-04-14 15:03 3 | # Author: https://github.com/lingchenzi/app 4 | # 国内走直连,其余走代理,可手动选节点 5 | 6 | [General] 7 | # 基础配置 8 | skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,e.crashlynatics.com 9 | bypass-tun = 10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,192.168.0.0/16,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4,255.255.255.255/32 10 | # ip匹配模式 11 | ip-mode = dual 12 | # ipv6设置 13 | ipv6-vif = auto 14 | # dns服务器,system表示系统自带dns服务器 15 | dns-server = system,223.5.5.5,129.29.29.29 16 | # DoH server,标准的url格式,以,分割多个地址 17 | doh-server=https://dns.alidns.com/dns-query,https://doh.pub/dns-query 18 | # dns拒绝模式:ip 19 | dns-reject-mode = LoopbackIP 20 | # 域名拒绝模式:ns 21 | domain-reject-mode = DNS 22 | # sni配置 23 | sni-sniffing = true 24 | # stun配置 25 | disable-stun = false 26 | # udp-fallback配置 27 | udp-fallback-mode = REJECT 28 | # 指定流量使用哪个网络接口进行转发 29 | interface-mode = auto 30 | # 策略断开链接 31 | disconnect-on-policy-change = false 32 | # 一个节点连接失败几次后会进行节点切换 33 | switch-node-after-failure-times = 3 34 | # 是否允许wifi下共享网络 35 | allow-wifi-access = false 36 | # Wifi开启开启时http服务端口 37 | wifi-access-http-port = 7222 38 | # Wifi开启开启时socks5服务端口 39 | wifi-access-socks5-port = 7221 40 | # 节点超时秒数 41 | test-timeout = 3 42 | # 节点测速url 43 | proxy-test-url = http://www.gstatic.com/generate_204 44 | # 检测网络可用时的url 45 | internet-test-url = http://connectivitycheck.platform.hicloud.com/generate_204 46 | # 资源解析器 47 | resource-parser = https://raw.githubusercontent.com/sub-store-org/Sub-Store/release/sub-store-parser.loon.min.js 48 | # geoip规则 49 | geoip-url = https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-Country.mmdb 50 | # ipasn规则 51 | ipasn-url = https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb 52 | 53 | 54 | [Proxy] 55 | # 策略 56 | 57 | [Remote Proxy] 58 | # 订阅节点 59 | 60 | [Remote Filter] 61 | # 节点筛选 62 | 63 | [Proxy Group] 64 | # 节点组 65 | 66 | [Proxy Chain] 67 | # 代理链 68 | 69 | [Rule] 70 | # 本地规则 71 | # Local Rule 72 | # Type:DOMAIN-SUFFIX,DOMAIN,DOMAIN-KEYWORD,USER-AGENT,URL-REGEX,IP-CIDR,IP-CIDR6,IP-ASN 73 | # Strategy:DIRECT,Proxy,REJECT 74 | # Options:no-resolve(no-resolve(only for cidr)) 75 | IP-CIDR, 10.0.0.0/8, no-resolve 76 | IP-CIDR, 100.64.0.0/10, no-resolve 77 | IP-CIDR, 127.0.0.0/8, no-resolve 78 | IP-CIDR, 172.16.0.0/12, no-resolve 79 | IP-CIDR, 192.0.0.0/24, no-resolve 80 | IP-CIDR, 192.168.0.0/16, no-resolve 81 | IP-CIDR, 198.18.0.0/15, no-resolve 82 | IP-CIDR, 224.0.0.0/4, no-resolve 83 | IP-CIDR6, ::1/128, no-resolve 84 | IP-CIDR6, fc00::/7, no-resolve 85 | IP-CIDR6, fe80::/10, no-resolve 86 | # 当配置文件中没有任何有效策略组时,Loon将使用内置的PROXY策略组 87 | # 配置文件自带geoip、ipasn规则 88 | # 如果启用geoip,需要禁用China系列订阅规则 89 | # GEOIP,CN,DIRECT 90 | # 兜底规则 91 | FINAL,PROXY 92 | 93 | [Remote Rule] 94 | # 订阅规则 95 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Loon/China/China_Domain.list, policy=DIRECT, tag=China Domain, enabled=true 96 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Loon/ChinaIPs/ChinaIPs.list, policy=DIRECT, tag=ChinaIPs, enabled=true 97 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Loon/ChinaMedia/ChinaMedia.list, policy=DIRECT, tag=ChinaMedia, enabled=true 98 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Loon/Global/Global.list, policy=PROXY, tag=Global, enabled=true 99 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Loon/Global/Global_Domain.list, policy=PROXY, tag=Global Domain, enabled=true 100 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Loon/GlobalMedia/GlobalMedia.list, policy=PROXY, tag=GlobalMedia, enabled=true 101 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Loon/GlobalMedia/GlobalMedia_Domain.list, policy=PROXY, tag=GlobalMedia Domain, enabled=true 102 | 103 | [Host] 104 | # 指定ip、域名等 105 | 106 | [Rewrite] 107 | # 本地重写 108 | 109 | [Script] 110 | # 脚本 111 | 112 | [Plugin] 113 | # 节点检测插件、复写插件 114 | https://kelee.one/Tool/Loon/Plugin/Node_detection_tool.plugin, enabled=true 115 | https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rewrite/Loon/Redirect/Redirect.plugin, enabled=true 116 | 117 | [Mitm] 118 | hostname = 119 | ca-p12 = 120 | ca-passphrase = 121 | skip-server-cert-verify=true 122 | -------------------------------------------------------------------------------- /ios-rule/Shadowrocket_Config.conf: -------------------------------------------------------------------------------- 1 | /* 2 | 说明:此配置文件适用于Shadowrocket应用程序,旨在实现大陆白名单功能。 3 | 作者:Aden 4 | 时间:2025-10-20 13:21 5 | 版权:此配置文件遵循MIT许可证,允许任何人免费使用、复制、修改和分发,但需保留原作者信息和许可证声明。 6 | 免责声明:使用此配置文件需自行承担风险。作者不对因使用此配置文件而导致的任何直接或间接损失负责。 7 | */ 8 | 9 | [General] 10 | # 旁路系统。如果禁用此选项,可能会导致一些系统问题,如推送通知延迟。 11 | bypass-system = true 12 | # 跳过代理。此选项强制这些域名或IP的连接范围由Shadowrocket TUN接口来处理,而不是Shadowrocket代理服务器。此选项用于解决一些应用程序的一些兼容性问题。 13 | skip-proxy = 127.0.0.1, localhost, *.local, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, captive.apple.com,*.ccb.com,*.abchina.com.cn,*.psbc.com 14 | # TUN旁路路由。Shadowrocket TUN接口只能处理TCP协议。使用此选项可以绕过指定的IP范围,让其他协议通过。 15 | tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 255.255.255.255/32, 239.255.255.250/32 16 | # DNS 服务器设置,优先使用系统 DNS,其次是阿里云、114DNS、Cloudflare 和 Google DNS 17 | dns-server = system, 223.5.5.5, 114.114.114.114, 1.1.1.1, 8.8.8.8 18 | # 启用 DoH(DNS over HTTPS)服务器 19 | doh-server = https://dns.alidns.com/dns-query, https://doh.pub/dns-query, https://1.1.1.1/dns-query 20 | # 启用IPv6支持。false表示不启用,true表示启用。 21 | ipv6 = true 22 | # 首选IPv6。优先向IPv6的DNS服务器查询AAAA记录,优先使用AAAA记录。false表示不启用。 23 | prefer-ipv6 = false 24 | # ping数据包自动回复。 25 | icmp-auto-reply = true 26 | # 不开启时,REJECT策略默认只有在配置模式下生效。开启后,可以令该策略在其他全局路由模式下都生效。 27 | always-reject-url-rewrite = false 28 | # 私有IP应答。如果不启用该选项,域名解析返回私有IP,Shadowrocket会认为该域名被劫持而强制使用代理。 29 | private-ip-answer = true 30 | # 直连域名解析失败后使用代理。false表示不启用。 31 | dns-direct-fallback-proxy = false 32 | # 当UDP流量匹配到规则里不支持UDP转发的节点策略时重新选择回退行为,可选行为包括DIRECT、REJECT。DIRECT表示直连转发UDP流量,REJECT表示拒绝转发UDP流量。 33 | udp-policy-not-supported-behaviour = REJECT 34 | 35 | 36 | [Proxy] 37 | # 添加本地节点。 38 | # Shadowsocks类型: 39 | # 节点名称=ss,地址,端口,password=密码,其他参数(如method=aes-256-cfb,obfs=websocket,plugin=none) 40 | # Vmess类型: 41 | # 节点名称=vmess,地址,端口,password=密码,其他参数(如alterId=0,method=auto,obfs=websocket,tfo=1) 42 | # VLESS类型: 43 | # 节点名称=vless,地址,端口,password=密码,tls=true,其他参数(如obfs=websocket,peer=example.com) 44 | # HTTP/HTTPS/Socks5/Socks5 Over TLS等类型: 45 | # 节点名称=http,地址,端口,用户,密码 46 | # 节点名称=https,地址,端口,用户,密码 47 | # 节点名称=socks5,地址,端口,用户,密码 48 | # 节点名称=socks5-tls,地址,端口,用户,密码,skip-common-name-verify=true 49 | # Trojan类型: 50 | # 节点名称=trojan,地址,端口,password=密码,其他参数(如allowInsecure=1,peer=example.com) 51 | 52 | 53 | [Proxy Group] 54 | # 代理分组类型: 55 | # select:手动选择节点。 56 | # url-test:自动选择延迟最低节点。 57 | # fallback:节点挂掉时自动切换其他可用节点。 58 | # load-balance:不同规则的请求使用分组里的不同节点进行连接。 59 | # random:随机使用分组里的不同节点进行连接。 60 | # ---------- 61 | # policy-regex-filter表示正则式或关键词筛选,常用写法: 62 | # 筛选保留节点名称含有关键词A和B的节点: 63 | # (?=.*(A))^(?=.*(B))^.*$ 64 | # 筛选保留节点名称含有关键词A或B的节点: 65 | # A|B 66 | # 筛选排除节点名称含有关键词A或B的节点: 67 | # ^((?!(A|B)).)*$ 68 | # 筛选保留节点名称含有关键词A并排除含有关键词B的节点: 69 | # (?=.*(A).)^((?!(B)).)*$ 70 | # ---------- 71 | # 代理分组其他设置参数: 72 | # interval:指定间隔多长时间后需要重新发起测试。 73 | # timeout:如果测试在超时前未完成,放弃测试。 74 | # tolerance:只有当新优胜者的分数高于旧优胜者的分数加上公差时,才会进行线路更换。 75 | # url:指定要测试的URL。 76 | # ---------- 77 | # 不含正则筛选的代理分组,示例: 78 | # 名称=类型(如select,url-test,fallback,load-balance,random),策略(如direct,proxy,订阅名称,代理分组,节点),interval=测试周期,timeout=超时时间,tolerance=公差,select=默认策略(0表示第一个策略,1表示第二个策略,2表示第三个策略……),url=测试地址 79 | # 含正则筛选的代理分组,示例: 80 | # 名称=类型(如select,url-test,fallback,load-balance,random),policy-regex-filter=正则式或关键词筛选,interval=测试周期,timeout=超时时间,tolerance=公差,select=默认策略(0表示第一个策略,1表示第二个策略,2表示第三个策略……),url=测试地址 81 | # ---------- 82 | 83 | [Rule] 84 | # 规则类型: 85 | # DOMAIN-SUFFIX:匹配请求域名的后缀。如“DOMAIN-SUFFIX,example.com,DIRECT”可以匹配到“a.example.com、a.b.example.com”。 86 | # DOMAIN-KEYWORD:匹配请求域名的关键词。如“DOMAIN-KEYWORD,exa,DIRECT”可以匹配到“a.example.com、a.b.example.com”。 87 | # DOMAIN:匹配请求的完整域名。如“DOMAIN,www.example.com,DIRECT”只能匹配到“www.example.com”。 88 | # USER-AGENT:匹配用户代理字符串,支持使用通配符“*”。如“USER-AGENT,MicroMessenger*,DIRECT”可以匹配到“MicroMessenger Client”。 89 | # URL-REGEX:匹配URL正则式。如“URL-REGEX,^https?://.+/item.+,REJECT”可以匹配到“https://www.example.com/item/abc/123”。 90 | # IP-CIDR:匹配IPv4或IPv6地址。如“IP-CIDR,192.168.1.0/24,DIRECT,no-resolve”可以匹配到IP段“192.168.1.1~192.168.1.254”。规则加no-resolve时,IP请求会匹配到这条规则,而域名请求不会用解析出来的IP去匹配这条规则。规则不加no-resolve时,则IP请求可匹配,域名解析后的IP也可匹配。 91 | # IP-ASN:匹配IP地址隶属的ASN编号。如“IP-ASN,56040,DIRECT”可以匹配到微信的相关IP请求。 92 | # RULE-SET:匹配规则集内容。规则集的组成部分需包含规则类型。 93 | # DOMAIN-SET:匹配域名集内容。域名集的组成部分不包含规则类型。 94 | # SCRIPT:匹配脚本名称。 95 | # DST-PORT:匹配目标主机名的端口号。如“DST-PORT,443,DIRECT”可以匹配到443目标端口。 96 | # GEOIP:匹配IP数据库。如“GEOIP,CN,DIRECT”可以匹配到归属地为CN的IP地址。 97 | # FINAL:兜底策略。如“FINAL,PROXY”表示当其他所有规则都匹配不到时才使用FINAL规则的策略。 98 | # AND:逻辑规则,与规则。如“AND,((DOMAIN,www.example.com),(DST-PORT,123)),DIRECT”可以匹配到“www.example.com:123”。 99 | # NOT:逻辑规则,非规则。如“NOT,((DST-PORT,123)),DIRECT”可以匹配到除了“123”端口的其他所有请求。 100 | # OR:逻辑规则,或规则。如“OR,((DST-PORT,123),(DST-PORT,456)),DIRECT”可以匹配到“123”或“456”端口的所有请求。 101 | # ---------- 102 | # 规则策略: 103 | # PROXY:代理。通过首页正在使用的代理服务器转发流量。 104 | # DIRECT:直连。连接不经过任何代理服务器。 105 | # REJECT:拒绝。返回HTTP状态码404,没有内容。 106 | # REJECT-DICT:拒绝。返回HTTP状态码200,内容为空的JSON对象。 107 | # REJECT-ARRAY:拒绝。返回HTTP状态码200,内容为空的JSON数组。 108 | # REJECT-200:拒绝。返回HTTP状态码200,没有内容。 109 | # REJECT-IMG:拒绝。返回HTTP状态码200,内容为1像素GIF。 110 | # REJECT-TINYGIF:拒绝。返回HTTP状态码200,内容为1像素GIF。 111 | # REJECT-DROP:拒绝。丢弃IP包。 112 | # REJECT-NO-DROP:拒绝。返回ICMP端口不可达。 113 | # 除此之外,规则策略还可以选择「代理分组」、「订阅名称」、「分组」、「节点」。 114 | # ---------- 115 | # 规则匹配的优先级: 116 | # 1.规则从上到下依次匹配。 117 | # 2.域名规则优先于IP规则。 118 | # ---------- 119 | # 关于屏蔽443端口的UDP流量的解释内容:HTTP3/QUIC协议开始流行,但是国内ISP和国际出口的UDP优先级都很低,表现很差,屏蔽掉以强制回退HTTP2/HTTP1.1。(如需启用该逻辑规则,请删除AND前面的注释符号#) 120 | # AND,((PROTOCOL,UDP),(DST-PORT,443)),REJECT-NO-DROP 121 | 122 | # 本地局域网地址的规则集,直连 123 | RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Shadowrocket/Lan/Lan.list,DIRECT 124 | 125 | # 自动更新的国内常用域名,直连 126 | RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Shadowrocket/China/China_Domain.list,DIRECT 127 | 128 | # 自动更新的国内 IP 段,直连 129 | RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Shadowrocket/China/China.list,DIRECT 130 | RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Shadowrocket/ChinaIPs/ChinaIPs.list,DIRECT 131 | RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Shadowrocket/ChinaIPs/ChinaIPs_Resolve.list,DIRECT 132 | 133 | # 自动更新的流媒体解锁规则,代理 134 | RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Shadowrocket/GlobalMedia/GlobalMedia.list,Proxy 135 | RULE-SET,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Shadowrocket/GlobalMedia/GlobalMedia_Domain.list,Proxy 136 | 137 | # 表示CN地区的IP分流走直连,GEOIP数据库用来判断IP是否属于CN地区。默认使用Shadowrocket自带的GEOIP数据库,如果您想替换其他数据库,可在 设置 - GeoLite2数据库 里添加和修改。 138 | GEOIP,CN,DIRECT 139 | 140 | # 兜底规则,表示当其他所有规则都匹配不到时才使用FINAL规则的策略。 141 | FINAL,Proxy 142 | 143 | 144 | [Host] 145 | # 域名指定本地值: 146 | # example.com=1.2.3.4 147 | # 域名指定DNS服务器: 148 | # example.com=server:1.2.3.4 149 | # wifi名称指定DNS服务器,如需指定多个DNS,可用逗号分隔: 150 | # ssid:wifi名称=server:1.2.3.4 151 | localhost = 127.0.0.1 152 | 153 | 154 | [URL Rewrite] 155 | # Google、Bing搜索引擎防跳转的重写。 156 | ^https?:\/\/(?:www\.)?g\.cn(?=\/|$) https://www.google.com 302 157 | ^https?:\/\/(?:www\.)?google\.cn(?=\/|$) https://www.google.com 302 158 | ^https?:\/\/(?:www\.)?google\.com\.hk(?=\/|$) https://www.google.com 302 159 | ^https?:\/\/(?:www\.)?google\.com\.tw(?=\/|$) https://www.google.com 302 160 | ^https?:\/\/(?:www\.)?google\.co\.jp(?=\/|$) https://www.google.com 302 161 | ^https?:\/\/(?:www\.)?google\.com\.sg(?=\/|$) https://www.google.com 302 162 | ^https?:\/\/(?:www\.)?google\.co\.kr(?=\/|$) https://www.google.com 302 163 | ^https?:\/\/cn\.bing\.com(?=\/|$) https://www.bing.com 302 164 | 165 | 166 | [Script] 167 | # JS脚本。 168 | 169 | 170 | [MITM] 171 | # Shadowrocket打开HTTPS解密方法: 172 | # 1.点击配置文件后面ⓘ - HTTPS解密 - 证书 - 生成新的CA证书 - 安装证书。 173 | # 2.手机设置 - 已下载描述文件 - 安装。 174 | # 3.手机设置 - 通用 - 关于本机 - 证书信任设置 - 开启对应Shadowrocket证书信任。 175 | # Shadowrocket仅会解密hostname指定的域名的请求,可以使用通配符。也可以使用前缀 - 排除特定主机名,如 -*.example.com。iOS系统和某些应用有严格的安全策略,仅信任某些特定的证书,对这些域名启动解密可能导致问题,如 *.apple.com,*.icloud.com。 176 | enable = true 177 | ca-passphrase = Shadowrocket 178 | ca-p12 = 179 | # 要解密的主机名(逗号分隔,支持通配符) 180 | hostname = g.cn,*.google.cn,*.google.com.hk,*.google.com.tw,*.google.co.jp,*.google.com.sg,*.google.co.kr,cn.bing.com 181 | -------------------------------------------------------------------------------- /ss/ss-rust.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin 3 | export PATH 4 | 5 | #================================================= 6 | # System Required: CentOS/Debian/Ubuntu 7 | # Description: Shadowsocks Rust 管理脚本 8 | # Author: 翠花 9 | # WebSite: https://about.nange.cn 10 | #================================================= 11 | 12 | sh_ver="1.4.5" 13 | filepath=$(cd "$(dirname "$0")"; pwd) 14 | file_1=$(echo -e "${filepath}"|awk -F "$0" '{print $1}') 15 | FOLDER="/etc/ss-rust" 16 | FILE="/usr/local/bin/ss-rust" 17 | CONF="/etc/ss-rust/config.json" 18 | Now_ver_File="/etc/ss-rust/ver.txt" 19 | Local="/etc/sysctl.d/local.conf" 20 | 21 | Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m" && Yellow_font_prefix="\033[0;33m" 22 | Info="${Green_font_prefix}[信息]${Font_color_suffix}" 23 | Error="${Red_font_prefix}[错误]${Font_color_suffix}" 24 | Tip="${Yellow_font_prefix}[注意]${Font_color_suffix}" 25 | 26 | check_root(){ 27 | [[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限),无法继续操作,请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1 28 | } 29 | 30 | check_sys(){ 31 | if [[ -f /etc/redhat-release ]]; then 32 | release="centos" 33 | elif cat /etc/issue | grep -q -E -i "debian"; then 34 | release="debian" 35 | elif cat /etc/issue | grep -q -E -i "ubuntu"; then 36 | release="ubuntu" 37 | elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then 38 | release="centos" 39 | elif cat /proc/version | grep -q -E -i "debian"; then 40 | release="debian" 41 | elif cat /proc/version | grep -q -E -i "ubuntu"; then 42 | release="ubuntu" 43 | elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then 44 | release="centos" 45 | fi 46 | } 47 | 48 | sysArch() { 49 | uname=$(uname -m) 50 | if [[ "$uname" == "i686" ]] || [[ "$uname" == "i386" ]]; then 51 | arch="i686" 52 | elif [[ "$uname" == *"armv7"* ]] || [[ "$uname" == "armv6l" ]]; then 53 | arch="arm" 54 | elif [[ "$uname" == *"armv8"* ]] || [[ "$uname" == "aarch64" ]]; then 55 | arch="aarch64" 56 | else 57 | arch="x86_64" 58 | fi 59 | } 60 | 61 | #开启系统 TCP Fast Open 62 | enable_systfo() { 63 | kernel=$(uname -r | awk -F . '{print $1}') 64 | if [ "$kernel" -ge 3 ]; then 65 | echo 3 >/proc/sys/net/ipv4/tcp_fastopen 66 | [[ ! -e $Local ]] && echo "fs.file-max = 51200 67 | net.core.rmem_max = 67108864 68 | net.core.wmem_max = 67108864 69 | net.core.rmem_default = 65536 70 | net.core.wmem_default = 65536 71 | net.core.netdev_max_backlog = 4096 72 | net.core.somaxconn = 4096 73 | net.ipv4.tcp_syncookies = 1 74 | net.ipv4.tcp_tw_reuse = 1 75 | net.ipv4.tcp_tw_recycle = 0 76 | net.ipv4.tcp_fin_timeout = 30 77 | net.ipv4.tcp_keepalive_time = 1200 78 | net.ipv4.ip_local_port_range = 10000 65000 79 | net.ipv4.tcp_max_syn_backlog = 4096 80 | net.ipv4.tcp_max_tw_buckets = 5000 81 | net.ipv4.tcp_fastopen = 3 82 | net.ipv4.tcp_rmem = 4096 87380 67108864 83 | net.ipv4.tcp_wmem = 4096 65536 67108864 84 | net.ipv4.tcp_mtu_probing = 1 85 | net.ipv4.tcp_ecn=1 86 | net.core.default_qdisc=fq 87 | net.ipv4.tcp_congestion_control = bbr" >>/etc/sysctl.d/local.conf && sysctl --system >/dev/null 2>&1 88 | else 89 | echo -e "$Error系统内核版本过低,无法支持 TCP Fast Open !" 90 | fi 91 | } 92 | 93 | check_installed_status(){ 94 | [[ ! -e ${FILE} ]] && echo -e "${Error} Shadowsocks Rust 没有安装,请检查!" && exit 1 95 | } 96 | 97 | check_status(){ 98 | status=`systemctl status ss-rust | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1` 99 | } 100 | 101 | check_new_ver(){ 102 | new_ver=$(wget -qO- https://api.github.com/repos/shadowsocks/shadowsocks-rust/releases| jq -r '[.[] | select(.prerelease == false) | select(.draft == false) | .tag_name] | .[0]') 103 | [[ -z ${new_ver} ]] && echo -e "${Error} Shadowsocks Rust 最新版本获取失败!" && exit 1 104 | echo -e "${Info} 检测到 Shadowsocks Rust 最新版本为 [ ${new_ver} ]" 105 | } 106 | 107 | check_ver_comparison(){ 108 | now_ver=$(cat ${Now_ver_File}) 109 | if [[ "${now_ver}" != "${new_ver}" ]]; then 110 | echo -e "${Info} 发现 Shadowsocks Rust 已有新版本 [ ${new_ver} ],旧版本 [ ${now_ver} ]" 111 | read -e -p "是否更新 ? [Y/n]:" yn 112 | [[ -z "${yn}" ]] && yn="y" 113 | if [[ $yn == [Yy] ]]; then 114 | check_status 115 | # [[ "$status" == "running" ]] && systemctl stop ss-rust 116 | \cp "${CONF}" "/tmp/config.json" 117 | # rm -rf ${FOLDER} 118 | Download 119 | mv -f "/tmp/config.json" "${CONF}" 120 | Restart 121 | fi 122 | else 123 | echo -e "${Info} 当前 Shadowsocks Rust 已是最新版本 [ ${new_ver} ] !" && exit 1 124 | fi 125 | } 126 | 127 | # Download(){ 128 | # if [[ ! -e "${FOLDER}" ]]; then 129 | # mkdir "${FOLDER}" 130 | # # else 131 | # # [[ -e "${FILE}" ]] && rm -rf "${FILE}" 132 | # fi 133 | # echo -e "${Info} 开始下载 Shadowsocks Rust ……" 134 | # wget --no-check-certificate -N "https://github.com/shadowsocks/shadowsocks-rust/releases/download/${new_ver}/shadowsocks-${new_ver}.${arch}-unknown-linux-gnu.tar.xz" 135 | # [[ ! -e "shadowsocks-${new_ver}.${arch}-unknown-linux-gnu.tar.xz" ]] && echo -e "${Error} Shadowsocks Rust 下载失败!" && exit 1 136 | # tar -xvf "shadowsocks-${new_ver}.${arch}-unknown-linux-gnu.tar.xz" 137 | # [[ ! -e "ssserver" ]] && echo -e "${Error} Shadowsocks Rust 压缩包解压失败!" && exit 1 138 | # rm -rf "shadowsocks-${new_ver}.${arch}-unknown-linux-gnu.tar.xz" 139 | # chmod +x ssserver 140 | # mv -f ssserver "${FILE}" 141 | # rm sslocal ssmanager ssservice ssurl 142 | # echo "${new_ver}" > ${Now_ver_File} 143 | # echo -e "${Info} Shadowsocks Rust 主程序下载安装完毕!" 144 | # } 145 | 146 | # 官方源 147 | stable_Download() { 148 | echo -e "${Info} 默认开始下载官方源 Shadowsocks Rust ……" 149 | wget --no-check-certificate -N "https://github.com/shadowsocks/shadowsocks-rust/releases/download/${new_ver}/shadowsocks-${new_ver}.${arch}-unknown-linux-gnu.tar.xz" 150 | if [[ ! -e "shadowsocks-${new_ver}.${arch}-unknown-linux-gnu.tar.xz" ]]; then 151 | echo -e "${Error} Shadowsocks Rust 官方源下载失败!" 152 | return 1 && exit 1 153 | else 154 | tar -xvf "shadowsocks-${new_ver}.${arch}-unknown-linux-gnu.tar.xz" 155 | fi 156 | if [[ ! -e "ssserver" ]]; then 157 | echo -e "${Error} Shadowsocks Rust 解压失败!" 158 | echo -e "${Error} Shadowsocks Rust 安装失败 !" 159 | return 1 && exit 1 160 | else 161 | rm -rf "shadowsocks-${new_ver}.${arch}-unknown-linux-gnu.tar.xz" 162 | chmod +x ssserver 163 | mv -f ssserver "${FILE}" 164 | rm sslocal ssmanager ssservice ssurl 165 | echo "${new_ver}" > ${Now_ver_File} 166 | 167 | echo -e "${Info} Shadowsocks Rust 主程序下载安装完毕!" 168 | return 0 169 | fi 170 | } 171 | 172 | # 备用源 173 | backup_Download() { 174 | echo -e "${Info} 试图请求 备份源(旧版本) Shadowsocks Rust ……" 175 | wget --no-check-certificate -N "https://raw.githubusercontent.com/xOS/Others/master/shadowsocks-rust/v1.14.1/shadowsocks-v1.14.1.${arch}-unknown-linux-gnu.tar.xz" 176 | if [[ ! -e "shadowsocks-v1.14.1.${arch}-unknown-linux-gnu.tar.xz" ]]; then 177 | echo -e "${Error} Shadowsocks Rust 备份源(旧版本) 下载失败!" 178 | return 1 && exit 1 179 | else 180 | tar -xvf "shadowsocks-v1.14.1.${arch}-unknown-linux-gnu.tar.xz" 181 | fi 182 | if [[ ! -e "ssserver" ]]; then 183 | echo -e "${Error} Shadowsocks Rust 备份源(旧版本) 解压失败 !" 184 | echo -e "${Error} Shadowsocks Rust 备份源(旧版本) 安装失败 !" 185 | return 1 && exit 1 186 | else 187 | rm -rf "shadowsocks-v1.14.1.${arch}-unknown-linux-gnu.tar.xz" 188 | chmod +x ssserver 189 | mv -f ssserver "${FILE}" 190 | rm sslocal ssmanager ssservice ssurl 191 | echo "v1.14.1" > ${Now_ver_File} 192 | echo -e "${Info} Shadowsocks Rust 备份源(旧版本) 主程序下载安装完毕!" 193 | return 0 194 | fi 195 | } 196 | 197 | Download() { 198 | if [[ ! -e "${FOLDER}" ]]; then 199 | mkdir "${FOLDER}" 200 | # else 201 | # [[ -e "${FILE}" ]] && rm -rf "${FILE}" 202 | fi 203 | stable_Download 204 | if [[ $? != 0 ]]; then 205 | backup_Download 206 | fi 207 | } 208 | 209 | Service(){ 210 | echo ' 211 | [Unit] 212 | Description= Shadowsocks Rust Service 213 | After=network-online.target 214 | Wants=network-online.target systemd-networkd-wait-online.service 215 | [Service] 216 | LimitNOFILE=32767 217 | Type=simple 218 | User=root 219 | Restart=on-failure 220 | RestartSec=5s 221 | DynamicUser=true 222 | ExecStartPre=/bin/sh -c 'ulimit -n 51200' 223 | ExecStart=/usr/local/bin/ss-rust -c /etc/ss-rust/config.json 224 | [Install] 225 | WantedBy=multi-user.target' > /etc/systemd/system/ss-rust.service 226 | systemctl enable --now ss-rust 227 | echo -e "${Info} Shadowsocks Rust 服务配置完成!" 228 | } 229 | 230 | Installation_dependency(){ 231 | if [[ ${release} == "centos" ]]; then 232 | yum update 233 | yum install jq gzip wget curl unzip xz openssl -y 234 | else 235 | apt-get update 236 | apt-get install jq gzip wget curl unzip xz-utils openssl -y 237 | fi 238 | \cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 239 | } 240 | 241 | Write_config(){ 242 | cat > ${CONF}<<-EOF 243 | { 244 | "server": "::", 245 | "server_port": ${port}, 246 | "password": "${password}", 247 | "method": "${cipher}", 248 | "fast_open": ${tfo}, 249 | "mode": "tcp_and_udp", 250 | "user":"nobody", 251 | "timeout":300, 252 | "nameserver":"8.8.8.8" 253 | } 254 | EOF 255 | } 256 | 257 | Read_config(){ 258 | [[ ! -e ${CONF} ]] && echo -e "${Error} Shadowsocks Rust 配置文件不存在!" && exit 1 259 | port=$(cat ${CONF}|jq -r '.server_port') 260 | password=$(cat ${CONF}|jq -r '.password') 261 | cipher=$(cat ${CONF}|jq -r '.method') 262 | tfo=$(cat ${CONF}|jq -r '.fast_open') 263 | } 264 | 265 | Set_port(){ 266 | while true 267 | do 268 | echo -e "${Tip} 本步骤不涉及系统防火墙端口操作,请手动放行相应端口!" 269 | echo -e "请输入 Shadowsocks Rust 端口 [1-65535]" 270 | read -e -p "(默认:2525):" port 271 | [[ -z "${port}" ]] && port="2525" 272 | echo $((${port}+0)) &>/dev/null 273 | if [[ $? -eq 0 ]]; then 274 | if [[ ${port} -ge 1 ]] && [[ ${port} -le 65535 ]]; then 275 | echo && echo "==================================" 276 | echo -e "端口:${Red_background_prefix} ${port} ${Font_color_suffix}" 277 | echo "==================================" && echo 278 | break 279 | else 280 | echo "输入错误, 请输入正确的端口。" 281 | fi 282 | else 283 | echo "输入错误, 请输入正确的端口。" 284 | fi 285 | done 286 | } 287 | 288 | Set_tfo(){ 289 | echo -e "是否开启 TCP Fast Open ? 290 | ================================== 291 | ${Green_font_prefix} 1.${Font_color_suffix} 开启 ${Green_font_prefix} 2.${Font_color_suffix} 关闭 292 | ==================================" 293 | read -e -p "(默认:1.开启):" tfo 294 | [[ -z "${tfo}" ]] && tfo="1" 295 | if [[ ${tfo} == "1" ]]; then 296 | tfo=true 297 | enable_systfo 298 | else 299 | tfo=false 300 | fi 301 | echo && echo "==================================" 302 | echo -e "TCP Fast Open 开启状态:${Red_background_prefix} ${tfo} ${Font_color_suffix}" 303 | echo "==================================" && echo 304 | } 305 | 306 | Set_password(){ 307 | echo "请输入 Shadowsocks Rust 密码 [0-9][a-z][A-Z]" 308 | read -e -p "(默认:随机生成 Base64):" password 309 | [[ -z "${password}" ]] && password=$(openssl rand -base64 16) 310 | echo && echo "==================================" 311 | echo -e "密码:${Red_background_prefix} ${password} ${Font_color_suffix}" 312 | echo "==================================" && echo 313 | } 314 | 315 | Set_cipher(){ 316 | echo -e "请选择 Shadowsocks Rust 加密方式 317 | ================================== 318 | ${Green_font_prefix} 1.${Font_color_suffix} aes-128-gcm ${Green_font_prefix}(默认)${Font_color_suffix} 319 | ${Green_font_prefix} 2.${Font_color_suffix} aes-256-gcm ${Green_font_prefix}(推荐)${Font_color_suffix} 320 | ${Green_font_prefix} 3.${Font_color_suffix} chacha20-ietf-poly1305 ${Green_font_prefix}${Font_color_suffix} 321 | ${Green_font_prefix} 4.${Font_color_suffix} plain ${Red_font_prefix}(不推荐)${Font_color_suffix} 322 | ${Green_font_prefix} 5.${Font_color_suffix} none ${Red_font_prefix}(不推荐)${Font_color_suffix} 323 | ${Green_font_prefix} 6.${Font_color_suffix} table 324 | ${Green_font_prefix} 7.${Font_color_suffix} aes-128-cfb 325 | ${Green_font_prefix} 8.${Font_color_suffix} aes-256-cfb 326 | ${Green_font_prefix} 9.${Font_color_suffix} aes-256-ctr 327 | ${Green_font_prefix}10.${Font_color_suffix} camellia-256-cfb 328 | ${Green_font_prefix}11.${Font_color_suffix} rc4-md5 329 | ${Green_font_prefix}12.${Font_color_suffix} chacha20-ietf 330 | ================================== 331 | ${Tip} AEAD 2022 加密(须v1.15.0及以上版本且密码须经过Base64加密) 332 | ================================== 333 | ${Green_font_prefix}13.${Font_color_suffix} 2022-blake3-aes-128-gcm ${Green_font_prefix}(推荐)${Font_color_suffix} 334 | ${Green_font_prefix}14.${Font_color_suffix} 2022-blake3-aes-256-gcm ${Green_font_prefix}(推荐)${Font_color_suffix} 335 | ${Green_font_prefix}15.${Font_color_suffix} 2022-blake3-chacha20-poly1305 336 | ${Green_font_prefix}16.${Font_color_suffix} 2022-blake3-chacha8-poly1305 337 | ================================== 338 | ${Tip} 如需其它加密方式请手动修改配置文件 !" && echo 339 | read -e -p "(默认: 1. aes-128-gcm):" cipher 340 | [[ -z "${cipher}" ]] && cipher="1" 341 | if [[ ${cipher} == "1" ]]; then 342 | cipher="aes-128-gcm" 343 | elif [[ ${cipher} == "2" ]]; then 344 | cipher="aes-256-gcm" 345 | elif [[ ${cipher} == "3" ]]; then 346 | cipher="chacha20-ietf-poly1305" 347 | elif [[ ${cipher} == "4" ]]; then 348 | cipher="plain" 349 | elif [[ ${cipher} == "5" ]]; then 350 | cipher="none" 351 | elif [[ ${cipher} == "6" ]]; then 352 | cipher="table" 353 | elif [[ ${cipher} == "7" ]]; then 354 | cipher="aes-128-cfb" 355 | elif [[ ${cipher} == "8" ]]; then 356 | cipher="aes-256-cfb" 357 | elif [[ ${cipher} == "9" ]]; then 358 | cipher="aes-256-ctr" 359 | elif [[ ${cipher} == "10" ]]; then 360 | cipher="camellia-256-cfb" 361 | elif [[ ${cipher} == "11" ]]; then 362 | cipher="arc4-md5" 363 | elif [[ ${cipher} == "12" ]]; then 364 | cipher="chacha20-ietf" 365 | elif [[ ${cipher} == "13" ]]; then 366 | cipher="2022-blake3-aes-128-gcm" 367 | elif [[ ${cipher} == "14" ]]; then 368 | cipher="2022-blake3-aes-256-gcm" 369 | elif [[ ${cipher} == "15" ]]; then 370 | cipher="2022-blake3-chacha20-poly1305" 371 | elif [[ ${cipher} == "16" ]]; then 372 | cipher="2022-blake3-chacha8-poly1305" 373 | else 374 | cipher="aes-128-gcm" 375 | fi 376 | echo && echo "==================================" 377 | echo -e "加密:${Red_background_prefix} ${cipher} ${Font_color_suffix}" 378 | echo "==================================" && echo 379 | } 380 | 381 | Set(){ 382 | check_installed_status 383 | echo && echo -e "你要做什么? 384 | ================================== 385 | ${Green_font_prefix}1.${Font_color_suffix} 修改 端口配置 386 | ${Green_font_prefix}2.${Font_color_suffix} 修改 密码配置 387 | ${Green_font_prefix}3.${Font_color_suffix} 修改 加密配置 388 | ${Green_font_prefix}4.${Font_color_suffix} 修改 TFO 配置 389 | ================================== 390 | ${Green_font_prefix}5.${Font_color_suffix} 修改 全部配置" && echo 391 | read -e -p "(默认:取消):" modify 392 | [[ -z "${modify}" ]] && echo "已取消..." && exit 1 393 | if [[ "${modify}" == "1" ]]; then 394 | Read_config 395 | Set_port 396 | password=${password} 397 | cipher=${cipher} 398 | tfo=${tfo} 399 | Write_config 400 | Restart 401 | elif [[ "${modify}" == "2" ]]; then 402 | Read_config 403 | Set_password 404 | port=${port} 405 | cipher=${cipher} 406 | tfo=${tfo} 407 | Write_config 408 | Restart 409 | elif [[ "${modify}" == "3" ]]; then 410 | Read_config 411 | Set_cipher 412 | port=${port} 413 | password=${password} 414 | tfo=${tfo} 415 | Write_config 416 | Restart 417 | elif [[ "${modify}" == "4" ]]; then 418 | Read_config 419 | Set_tfo 420 | cipher=${cipher} 421 | port=${port} 422 | password=${password} 423 | Write_config 424 | Restart 425 | elif [[ "${modify}" == "5" ]]; then 426 | Read_config 427 | Set_port 428 | Set_password 429 | Set_cipher 430 | Set_tfo 431 | Write_config 432 | Restart 433 | else 434 | echo -e "${Error} 请输入正确的数字(1-5)" && exit 1 435 | fi 436 | } 437 | 438 | Install(){ 439 | [[ -e ${FILE} ]] && echo -e "${Error} 检测到 Shadowsocks Rust 已安装!" && exit 1 440 | echo -e "${Info} 开始设置 配置..." 441 | Set_port 442 | Set_password 443 | Set_cipher 444 | Set_tfo 445 | echo -e "${Info} 开始安装/配置 依赖..." 446 | Installation_dependency 447 | echo -e "${Info} 开始下载/安装..." 448 | check_new_ver 449 | Download 450 | echo -e "${Info} 开始安装系统服务脚本..." 451 | Service 452 | echo -e "${Info} 开始写入 配置文件..." 453 | Write_config 454 | echo -e "${Info} 所有步骤 安装完毕,开始启动..." 455 | Start 456 | } 457 | 458 | Start(){ 459 | check_installed_status 460 | check_status 461 | [[ "$status" == "running" ]] && echo -e "${Info} Shadowsocks Rust 已在运行 !" && exit 1 462 | systemctl start ss-rust 463 | check_status 464 | [[ "$status" == "running" ]] && echo -e "${Info} Shadowsocks Rust 启动成功 !" 465 | sleep 3s 466 | Start_Menu 467 | } 468 | 469 | Stop(){ 470 | check_installed_status 471 | check_status 472 | [[ !"$status" == "running" ]] && echo -e "${Error} Shadowsocks Rust 没有运行,请检查!" && exit 1 473 | systemctl stop ss-rust 474 | sleep 3s 475 | Start_Menu 476 | } 477 | 478 | Restart(){ 479 | check_installed_status 480 | systemctl restart ss-rust 481 | echo -e "${Info} Shadowsocks Rust 重启完毕 !" 482 | sleep 3s 483 | View 484 | Start_Menu 485 | } 486 | 487 | Update(){ 488 | check_installed_status 489 | check_new_ver 490 | check_ver_comparison 491 | echo -e "${Info} Shadowsocks Rust 更新完毕!" 492 | sleep 3s 493 | Start_Menu 494 | } 495 | 496 | Uninstall(){ 497 | check_installed_status 498 | echo "确定要卸载 Shadowsocks Rust ? (y/N)" 499 | echo 500 | read -e -p "(默认:n):" unyn 501 | [[ -z ${unyn} ]] && unyn="n" 502 | if [[ ${unyn} == [Yy] ]]; then 503 | check_status 504 | [[ "$status" == "running" ]] && systemctl stop ss-rust 505 | systemctl disable ss-rust 506 | rm -rf "${FOLDER}" 507 | rm -rf "${FILE}" 508 | echo && echo "Shadowsocks Rust 卸载完成!" && echo 509 | else 510 | echo && echo "卸载已取消..." && echo 511 | fi 512 | sleep 3s 513 | Start_Menu 514 | } 515 | 516 | getipv4(){ 517 | ipv4=$(wget -qO- -4 -t1 -T2 ipinfo.io/ip) 518 | if [[ -z "${ipv4}" ]]; then 519 | ipv4=$(wget -qO- -4 -t1 -T2 api.ip.sb/ip) 520 | if [[ -z "${ipv4}" ]]; then 521 | ipv4=$(wget -qO- -4 -t1 -T2 members.3322.org/dyndns/getip) 522 | if [[ -z "${ipv4}" ]]; then 523 | ipv4="IPv4_Error" 524 | fi 525 | fi 526 | fi 527 | } 528 | getipv6(){ 529 | ipv6=$(wget -qO- -6 -t1 -T2 ifconfig.co) 530 | if [[ -z "${ipv6}" ]]; then 531 | ipv6="IPv6_Error" 532 | fi 533 | } 534 | 535 | urlsafe_base64(){ 536 | date=$(echo -n "$1"|base64|sed ':a;N;s/\n/ /g;ta'|sed 's/ //g;s/=//g;s/+/-/g;s/\//_/g') 537 | echo -e "${date}" 538 | } 539 | 540 | Link_QR(){ 541 | if [[ "${ipv4}" != "IPv4_Error" ]]; then 542 | SSbase64=$(urlsafe_base64 "${cipher}:${password}@${ipv4}:${port}") 543 | SSurl="ss://${SSbase64}" 544 | SSQRcode="https://cli.im/api/qrcode/code?text=${SSurl}" 545 | link_ipv4=" 链接 [IPv4]:${Red_font_prefix}${SSurl}${Font_color_suffix} \n 二维码[IPv4]:${Red_font_prefix}${SSQRcode}${Font_color_suffix}" 546 | fi 547 | if [[ "${ipv6}" != "IPv6_Error" ]]; then 548 | SSbase64=$(urlsafe_base64 "${cipher}:${password}@${ipv6}:${port}") 549 | SSurl="ss://${SSbase64}" 550 | SSQRcode="https://cli.im/api/qrcode/code?text=${SSurl}" 551 | link_ipv6=" 链接 [IPv6]:${Red_font_prefix}${SSurl}${Font_color_suffix} \n 二维码[IPv6]:${Red_font_prefix}${SSQRcode}${Font_color_suffix}" 552 | fi 553 | } 554 | 555 | View(){ 556 | check_installed_status 557 | Read_config 558 | getipv4 559 | getipv6 560 | Link_QR 561 | clear && echo 562 | echo -e "Shadowsocks Rust 配置:" 563 | echo -e "——————————————————————————————————" 564 | [[ "${ipv4}" != "IPv4_Error" ]] && echo -e " 地址:${Green_font_prefix}${ipv4}${Font_color_suffix}" 565 | [[ "${ipv6}" != "IPv6_Error" ]] && echo -e " 地址:${Green_font_prefix}${ipv6}${Font_color_suffix}" 566 | echo -e " 端口:${Green_font_prefix}${port}${Font_color_suffix}" 567 | echo -e " 密码:${Green_font_prefix}${password}${Font_color_suffix}" 568 | echo -e " 加密:${Green_font_prefix}${cipher}${Font_color_suffix}" 569 | echo -e " TFO :${Green_font_prefix}${tfo}${Font_color_suffix}" 570 | echo -e "——————————————————————————————————" 571 | [[ ! -z "${link_ipv4}" ]] && echo -e "${link_ipv4}" 572 | [[ ! -z "${link_ipv6}" ]] && echo -e "${link_ipv6}" 573 | echo -e "—————————————————————————" 574 | echo -e "${Info} Surge 配置:" 575 | if [[ "${ipv4}" != "IPv4_Error" ]]; then 576 | echo -e "$(uname -n) = ss,${ipv4},${port},encrypt-method=${cipher},password=${password},tfo=${tfo},udp-relay=true,ecn=true" 577 | else 578 | echo -e "$(uname -n) = ss,${ipv6},${port},encrypt-method=${cipher},password=${password},tfo=${tfo},udp-relay=true,ecn=true" 579 | fi 580 | echo -e "—————————————————————————" 581 | Before_Start_Menu 582 | } 583 | 584 | Status(){ 585 | echo -e "${Info} 获取 Shadowsocks Rust 活动日志 ……" 586 | echo -e "${Tip} 返回主菜单请按 q !" 587 | systemctl status ss-rust 588 | Start_Menu 589 | } 590 | 591 | Update_Shell(){ 592 | echo -e "当前版本为 [ ${sh_ver} ],开始检测最新版本..." 593 | sh_new_ver=$(wget --no-check-certificate -qO- "https://raw.githubusercontent.com/xOS/Shadowsocks-Rust/master/ss-rust.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1) 594 | [[ -z ${sh_new_ver} ]] && echo -e "${Error} 检测最新版本失败 !" && Start_Menu 595 | if [[ ${sh_new_ver} != ${sh_ver} ]]; then 596 | echo -e "发现新版本[ ${sh_new_ver} ],是否更新?[Y/n]" 597 | read -p "(默认:y):" yn 598 | [[ -z "${yn}" ]] && yn="y" 599 | if [[ ${yn} == [Yy] ]]; then 600 | wget -O ss-rust.sh --no-check-certificate https://raw.githubusercontent.com/xOS/Shadowsocks-Rust/master/ss-rust.sh && chmod +x ss-rust.sh 601 | echo -e "脚本已更新为最新版本[ ${sh_new_ver} ]!" 602 | echo -e "3s后执行新脚本" 603 | sleep 3s 604 | bash ss-rust.sh 605 | else 606 | echo && echo " 已取消..." && echo 607 | sleep 3s 608 | Start_Menu 609 | fi 610 | else 611 | echo -e "当前已是最新版本[ ${sh_new_ver} ] !" 612 | sleep 3s 613 | Start_Menu 614 | fi 615 | sleep 3s 616 | bash ss-rust.sh 617 | } 618 | 619 | Before_Start_Menu() { 620 | echo && echo -n -e "${yellow}* 按回车返回主菜单 *${plain}" && read temp 621 | Start_Menu 622 | } 623 | 624 | Start_Menu(){ 625 | clear 626 | check_root 627 | check_sys 628 | sysArch 629 | action=$1 630 | echo && echo -e " 631 | ================================== 632 | Shadowsocks Rust 管理脚本 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix} 633 | ================================== 634 | ${Green_font_prefix} 0.${Font_color_suffix} 更新脚本 635 | —————————————————————————————————— 636 | ${Green_font_prefix} 1.${Font_color_suffix} 安装 Shadowsocks Rust 637 | ${Green_font_prefix} 2.${Font_color_suffix} 更新 Shadowsocks Rust 638 | ${Green_font_prefix} 3.${Font_color_suffix} 卸载 Shadowsocks Rust 639 | —————————————————————————————————— 640 | ${Green_font_prefix} 4.${Font_color_suffix} 启动 Shadowsocks Rust 641 | ${Green_font_prefix} 5.${Font_color_suffix} 停止 Shadowsocks Rust 642 | ${Green_font_prefix} 6.${Font_color_suffix} 重启 Shadowsocks Rust 643 | —————————————————————————————————— 644 | ${Green_font_prefix} 7.${Font_color_suffix} 设置 配置信息 645 | ${Green_font_prefix} 8.${Font_color_suffix} 查看 配置信息 646 | ${Green_font_prefix} 9.${Font_color_suffix} 查看 运行状态 647 | —————————————————————————————————— 648 | ${Green_font_prefix} 10.${Font_color_suffix} 退出脚本 649 | ==================================" && echo 650 | if [[ -e ${FILE} ]]; then 651 | check_status 652 | if [[ "$status" == "running" ]]; then 653 | echo -e " 当前状态:${Green_font_prefix}已安装${Font_color_suffix} 并 ${Green_font_prefix}已启动${Font_color_suffix}" 654 | else 655 | echo -e " 当前状态:${Green_font_prefix}已安装${Font_color_suffix} 但 ${Red_font_prefix}未启动${Font_color_suffix}" 656 | fi 657 | else 658 | echo -e " 当前状态:${Red_font_prefix}未安装${Font_color_suffix}" 659 | fi 660 | echo 661 | read -e -p " 请输入数字 [0-10]:" num 662 | case "$num" in 663 | 0) 664 | Update_Shell 665 | ;; 666 | 1) 667 | Install 668 | ;; 669 | 2) 670 | Update 671 | ;; 672 | 3) 673 | Uninstall 674 | ;; 675 | 4) 676 | Start 677 | ;; 678 | 5) 679 | Stop 680 | ;; 681 | 6) 682 | Restart 683 | ;; 684 | 7) 685 | Set 686 | ;; 687 | 8) 688 | View 689 | ;; 690 | 9) 691 | Status 692 | ;; 693 | 10) 694 | exit 1 695 | ;; 696 | *) 697 | echo "请输入正确数字 [0-10]" 698 | ;; 699 | esac 700 | } 701 | Start_Menu 702 | --------------------------------------------------------------------------------