├── .github └── workflows │ ├── netflix-verify.yaml │ ├── refresh-jsdelivr.yaml │ ├── wgcf.yaml │ └── wireproxy.yaml ├── LICENSE ├── README.md ├── files ├── netflix-verify │ ├── nf-linux-amd64 │ ├── nf-linux-arm64 │ ├── nf-linux-s390x │ └── nfverify-fetchlog.txt ├── teams.xml ├── tun.sh ├── wgcf │ ├── wgcf-fetchlog.txt │ ├── wgcf-latest-linux-amd64 │ ├── wgcf-latest-linux-arm64 │ └── wgcf-latest-linux-s390x ├── wireguard-go │ ├── wireguard-go-amd64 │ ├── wireguard-go-arm64 │ └── wireguard-go-s390x ├── wireproxy │ ├── wireproxy-fetchlog.txt │ ├── wireproxy-latest-linux-amd64 │ ├── wireproxy-latest-linux-arm64 │ └── wireproxy-latest-linux-s390x └── wp-plus.py └── warp.sh /.github/workflows/netflix-verify.yaml: -------------------------------------------------------------------------------- 1 | name: Fetch Netflix verify to latest version 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: "00 10 * * *" 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v3.1.0 14 | - name: Fetch Netfilx verify latest version 15 | run: | 16 | rm -f files/netflix-verify/nf-linux-amd64 files/netflix-verify/nf-linux-arm64 files/netflix-verify/nf-linux-s390x files/netflix-verify/nfverify-fetchlog.txt 17 | actions_date=$(date) 18 | repo_last_ver=$(curl -Ls "https://api.github.com/repos/sjlleo/netflix-verify/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') 19 | wget https://github.com/sjlleo/netflix-verify/releases/download/$repo_last_ver/nf_linux_amd64 -O files/netflix-verify/nf-linux-amd64 20 | wget https://github.com/sjlleo/netflix-verify/releases/download/$repo_last_ver/nf_linux_arm64 -O files/netflix-verify/nf-linux-arm64 21 | wget https://github.com/sjlleo/netflix-verify/releases/download/$repo_last_ver/nf_linux_s390x -O files/netflix-verify/nf-linux-s390x 22 | cat < files/netflix-verify/nfverify-fetchlog.txt 23 | # Netfilx verify fetch log generated by GitHub Actions 24 | Last Version: $repo_last_ver 25 | Fetch Date: $actions_date 26 | EOF 27 | - name: Upload to GitHub 28 | run: | 29 | git config --global user.email "actions@github.com" 30 | git config --global user.name "GitHub Actions" 31 | git add . 32 | git commit -m "CI: Auto fetch Netflix verify at $(date +"%m-%d %H:%M")" 33 | git push 34 | - name: Refresh Jsdelivr cache 35 | run: | 36 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/netflix-verify/nf-linux-amd64 37 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/netflix-verify/nf-linux-arm64 38 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/netflix-verify/nf-linux-s390x -------------------------------------------------------------------------------- /.github/workflows/refresh-jsdelivr.yaml: -------------------------------------------------------------------------------- 1 | name: Fetch script's Jsdelivr cache 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'warp.sh' 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Fetch script's Jsdelivr cache 14 | run: | 15 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/warp.sh -------------------------------------------------------------------------------- /.github/workflows/wgcf.yaml: -------------------------------------------------------------------------------- 1 | name: Fetch wgcf to latest version 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: "30 12 * * *" 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v3.1.0 14 | - name: Fetch wgcf to latest version 15 | run: | 16 | rm -f files/wgcf/wgcf-latest-linux-amd64 files/wgcf/wgcf-latest-linux-arm64 files/wgcf/wgcf-latest-linux-s390x files/wgcf/wgcf-fetchlog.txt 17 | actions_date=$(date) 18 | repo_last_ver=$(curl -Ls "https://api.github.com/repos/ViRb3/wgcf/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') 19 | repo_ver_name=$(curl -Ls "https://api.github.com/repos/ViRb3/wgcf/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed "s/v//g") 20 | wget https://github.com/ViRb3/wgcf/releases/download/$repo_last_ver/wgcf_"$repo_ver_name"_linux_amd64 -O files/wgcf/wgcf-latest-linux-amd64 21 | wget https://github.com/ViRb3/wgcf/releases/download/$repo_last_ver/wgcf_"$repo_ver_name"_linux_arm64 -O files/wgcf/wgcf-latest-linux-arm64 22 | wget https://github.com/ViRb3/wgcf/releases/download/$repo_last_ver/wgcf_"$repo_ver_name"_linux_s390x -O files/wgcf/wgcf-latest-linux-s390x 23 | cat < files/wgcf/wgcf-fetchlog.txt 24 | # wgcf fetch log generated by GitHub Actions 25 | Last Version: $repo_last_ver 26 | Fetch Date: $actions_date 27 | EOF 28 | - name: Upload to GitHub 29 | run: | 30 | git config --global user.email "actions@github.com" 31 | git config --global user.name "GitHub Actions" 32 | git add . 33 | git commit -m "CI: Auto fetch wgcf at $(date +"%m-%d %H:%M")" 34 | git push 35 | - name: Refresh Jsdelivr cache 36 | run: | 37 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/wgcf/wgcf-latest-linux-amd64 38 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/wgcf/wgcf-latest-linux-arm64 39 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/wgcf/wgcf-latest-linux-s390x -------------------------------------------------------------------------------- /.github/workflows/wireproxy.yaml: -------------------------------------------------------------------------------- 1 | name: Fetch wireproxy to latest version 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: "00 12 * * *" 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v3.1.0 14 | - name: Fetch wireproxy to latest version 15 | run: | 16 | rm -f files/wireproxy/wireproxy-latest-linux-amd64 files/wireproxy/wireproxy-latest-linux-arm64 files/wireproxy/wireproxy-latest-linux-s390x files/wireproxy/wireproxy-fetchlog.txt 17 | actions_date=$(date) 18 | repo_last_ver=$(curl -Ls "https://api.github.com/repos/octeep/wireproxy/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') 19 | wget -N https://github.com/octeep/wireproxy/releases/download/$repo_last_ver/wireproxy_linux_amd64.tar.gz 20 | tar -zxvf wireproxy_linux_amd64.tar.gz 21 | rm -f wireproxy_linux_amd64.tar.gz 22 | mv -f wireproxy files/wireproxy/wireproxy-latest-linux-amd64 23 | wget -N https://github.com/octeep/wireproxy/releases/download/$repo_last_ver/wireproxy_linux_arm64.tar.gz 24 | tar -zxvf wireproxy_linux_arm64.tar.gz 25 | rm -f wireproxy_linux_arm64.tar.gz 26 | mv -f wireproxy files/wireproxy/wireproxy-latest-linux-arm64 27 | wget -N https://github.com/octeep/wireproxy/releases/download/$repo_last_ver/wireproxy_linux_s390x.tar.gz 28 | tar -zxvf wireproxy_linux_s390x.tar.gz 29 | rm -f wireproxy_linux_s390x.tar.gz 30 | mv -f wireproxy files/wireproxy/wireproxy-latest-linux-s390x 31 | cat < files/wireproxy/wireproxy-fetchlog.txt 32 | # wireproxy fetch log generated by GitHub Actions 33 | Last Version: $repo_last_ver 34 | Fetch Date: $actions_date 35 | EOF 36 | - name: Upload to GitHub 37 | run: | 38 | git config --global user.email "actions@github.com" 39 | git config --global user.name "GitHub Actions" 40 | git add . 41 | git commit -m "CI: Auto fetch wireproxy at $(date +"%m-%d %H:%M")" 42 | git push 43 | - name: Refresh Jsdelivr cache 44 | run: | 45 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/wireproxy/wireproxy-latest-linux-amd64 46 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/wireproxy/wireproxy-latest-linux-arm64 47 | curl https://purge.jsdelivr.net/gh/mikupeto/warp-script/files/wireproxy/wireproxy-latest-linux-s390x -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # warp-script 2 | 3 | ```shell 4 | wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/mikupeto/warp-script/warp.sh && bash warp.sh 5 | ``` 6 | -------------------------------------------------------------------------------- /files/netflix-verify/nf-linux-amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/netflix-verify/nf-linux-amd64 -------------------------------------------------------------------------------- /files/netflix-verify/nf-linux-arm64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/netflix-verify/nf-linux-arm64 -------------------------------------------------------------------------------- /files/netflix-verify/nf-linux-s390x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/netflix-verify/nf-linux-s390x -------------------------------------------------------------------------------- /files/netflix-verify/nfverify-fetchlog.txt: -------------------------------------------------------------------------------- 1 | # Netfilx verify fetch log generated by GitHub Actions 2 | Last Version: v3.1.0-1 3 | Fetch Date: Tue Mar 11 10:20:41 UTC 2025 4 | -------------------------------------------------------------------------------- /files/teams.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | eyJhbGciOiJSUzI1NiIsImtpZCI6ImJhY2EwYzU4MzI4NjkwNmY4ZDVkNjg1OWUwNDI1ODBjZTliNzA4ZmQ0NzVhMGY1ODI5MzcyODMyNDI1NzIwNTUifQ.eyJ0eXBlIjoiZG9oIiwiYXVkIjoiY2xvdWRmbGFyZS1nYXRld2F5LmNvbSIsImlhdCI6MTY2Mjc3ODA0MywiZXhwIjoxNjYyODY0NDQzLCJhY2NvdW50LWlkIjoiZGRjOTg4YjFhMmI0MTJhM2Y1NTM3YmNjNmY4YWZkZWIiLCJ1c2VyLWlkIjoiNDk5ODBkYTEtZTNjNy00Y2JmLWE3NzgtZTE2NWQ0Yjg3MDI3IiwiZGV2aWNlLWlkIjoiZTRkMDBjNDgtMzBiMi0xMWVkLWE3YjAtNTJlMjBmZTUwNWM4In0.eMifyDquP_tfSrQps5EXFRalhdmJLmDy3wwqE6f8P0kJ4B5vDZ0wOAh9Fv4S6GDkwvXFlz7PyrpcfGT-LodcM-b7fPtCOJ8OQlGsbm8hWOFCM6j6mHsGJGpDWYxQ0UGCWd_CLyGyUQI5S1Iqn_j0aWRrfcEQ95k8Sygt2_AlRDYb1S38MeKYi4un6Pj0gRIaxpcYxfxPI3iEwwVEnI-QD7B5L77l-UoUsBuR8o9p_wKk_bV3VpB9XU7_hNhopfgM7U_6rowAfjKgGi1SX43Kc9iAv2K4FVIwgRNHnHsOoobIzBagxDXM3vgonrKUiG63WyoO2YND2v36c84zn332iQ 5 | WARP 6 | {"organization":"xxzkigogtlsq","gateway_unique_id":"ddc988b1a2b412a3f5537bcc6f8afdeb","exclude":[{"address":"10.0.0.0/8"},{"address":"100.64.0.0/10"},{"address":"169.254.0.0/16"},{"address":"172.16.0.0/12"},{"address":"192.0.0.0/24"},{"address":"192.168.0.0/16"},{"address":"224.0.0.0/24"},{"address":"240.0.0.0/4"},{"address":"255.255.255.255/32"},{"address":"fe80::/10"},{"address":"fd00::/8"},{"address":"ff01::/16"},{"address":"ff02::/16"},{"address":"ff03::/16"},{"address":"ff04::/16"},{"address":"ff05::/16"}],"fallback_domains":[{"suffix":"home.arpa"},{"suffix":"intranet"},{"suffix":"internal"},{"suffix":"private"},{"suffix":"localdomain"},{"suffix":"domain"},{"suffix":"lan"},{"suffix":"home"},{"suffix":"host"},{"suffix":"corp"},{"suffix":"local"},{"suffix":"localhost"},{"suffix":"invalid"},{"suffix":"test"}],"allow_mode_switch":false} 7 | t.e4d00c48-30b2-11ed-a7b0-52e20fe505c8 8 | xxzkigogtlsq 9 | N5sBP+i8YM2/mBjO0dpBo7S90SYkL9kInaGl8Wtxd30= 10 | 11 | 12 | 13 | 14 | 15 | 16 | {"premium_data_bytes":0,"referral_reward_bytes":1000000000,"denylist":[{"name":"Netflix","visible":true,"android-packages":["com.netflix.mediaclient"]},{"name":"BBC iPlayer","visible":true,"android-packages":["com.bbc.globaliplayerradio.international","bbc.iplayer.android"]},{"name":"YouTube","visible":true,"android-packages":["com.google.android.youtube","com.google.android.apps.youtube.mango"]},{"name":"DisneyLife","visible":true,"android-packages":["com.disney.disneylife_goo"]},{"name":"Hulu","visible":true,"android-packages":["com.hulu.plus"]},{"name":"HBO","visible":true,"android-packages":["com.hbo.hbonow"]},{"name":"Google Photos","visible":true,"android-packages":["com.google.android.apps.photos"]},{"name":"LAN","visible":false,"networks":{"v4":[{"address":"10.0.0.0","netmask":"255.0.0.0"},{"address":"100.64.0.0","netmask":"255.192.0.0"},{"address":"169.254.0.0","netmask":"255.255.0.0"},{"address":"172.16.0.0","netmask":"255.240.0.0"},{"address":"192.0.0.0","netmask":"255.255.255.0"},{"address":"192.168.0.0","netmask":"255.255.0.0"},{"address":"224.0.0.0","netmask":"255.255.255.0"},{"address":"240.0.0.0","netmask":"240.0.0.0"},{"address":"255.255.255.255","netmask":"255.255.255.255"}],"v6":[{"address":"fe80::","prefix":"10"},{"address":"fd00::","prefix":"8"},{"address":"ff01::","prefix":"16"},{"address":"ff02::","prefix":"16"},{"address":"ff03::","prefix":"16"},{"address":"ff04::","prefix":"16"},{"address":"ff05::","prefix":"16"},{"address":"fc00::","prefix":"7"}]}}]} 17 | ddc988b1a2b412a3f5537bcc6f8afdeb 18 | 5030b3a9-c219-42c6-960a-4524813199ba 19 | {"peers":[{"public_key":"bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=","endpoint":{"v4":"162.159.193.5:0","v6":"[2606:4700:100::a29f:c105]:0"}}],"client_id":"5gaI","interface":{"addresses":{"v4":"172.16.0.2","v6":"2606:4700:110:86bd:f50e:6330:a788:acdf"}},"services":{"http_proxy":"172.16.0.1:2480"}} 20 | 21 | G9nrlwzuhyDQj8G2lJYAwNDvS/NL6UgTosBQq4ZJCaE= 22 | {"id":"ddc988b1a2b412a3f5537bcc6f8afdeb","account_type":"team","premium_data":0,"quota":0,"referral_count":0,"managed":"not_api_managed"} 23 | t.e4d00c48-30b2-11ed-a7b0-52e20fe505c8 24 | {"managed":"not_api_managed","accountAppConfiguration":{"organization":"xxzkigogtlsq","gateway_unique_id":"ddc988b1a2b412a3f5537bcc6f8afdeb","exclude":[{"address":"10.0.0.0/8"},{"address":"100.64.0.0/10"},{"address":"169.254.0.0/16"},{"address":"172.16.0.0/12"},{"address":"192.0.0.0/24"},{"address":"192.168.0.0/16"},{"address":"224.0.0.0/24"},{"address":"240.0.0.0/4"},{"address":"255.255.255.255/32"},{"address":"fe80::/10"},{"address":"fd00::/8"},{"address":"ff01::/16"},{"address":"ff02::/16"},{"address":"ff03::/16"},{"address":"ff04::/16"},{"address":"ff05::/16"}],"fallback_domains":[{"suffix":"home.arpa"},{"suffix":"intranet"},{"suffix":"internal"},{"suffix":"private"},{"suffix":"localdomain"},{"suffix":"domain"},{"suffix":"lan"},{"suffix":"home"},{"suffix":"host"},{"suffix":"corp"},{"suffix":"local"},{"suffix":"localhost"},{"suffix":"invalid"},{"suffix":"test"}],"allow_mode_switch":false}} 25 | 26 | 2022-09-10T01:23:13.824Z 27 | -------------------------------------------------------------------------------- /files/tun.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | red() { 4 | echo -e "\033[31m\033[01m$1\033[0m" 5 | } 6 | 7 | green() { 8 | echo -e "\033[32m\033[01m$1\033[0m" 9 | } 10 | 11 | yellow() { 12 | echo -e "\033[33m\033[01m$1\033[0m" 13 | } 14 | 15 | # 判断系统及定义系统安装依赖方式 16 | REGEX=("debian" "ubuntu" "centos|red hat|kernel|oracle linux|alma|rocky" "'amazon linux'") 17 | RELEASE=("Debian" "Ubuntu" "CentOS" "CentOS" "Alpine") 18 | PACKAGE_UPDATE=("apt -y update" "apt -y update" "yum -y update" "yum -y update") 19 | PACKAGE_INSTALL=("apt -y install" "apt -y install" "yum -y install" "yum -y install") 20 | PACKAGE_REMOVE=("apt -y remove" "apt -y remove" "yum -y remove" "yum -y remove") 21 | 22 | # 判断是否为root用户 23 | [[ $EUID -ne 0 ]] && red "请在root用户下运行脚本" && exit 1 24 | 25 | # 检测系统,本部分代码感谢fscarmen的指导 26 | CMD=("$(grep -i pretty_name /etc/os-release 2>/dev/null | cut -d \" -f2)" "$(hostnamectl 2>/dev/null | grep -i system | cut -d : -f2)" "$(lsb_release -sd 2>/dev/null)" "$(grep -i description /etc/lsb-release 2>/dev/null | cut -d \" -f2)" "$(grep . /etc/redhat-release 2>/dev/null)" "$(grep . /etc/issue 2>/dev/null | cut -d \\ -f1 | sed '/^[ ]*$/d')") 27 | 28 | for i in "${CMD[@]}"; do 29 | SYS="$i" && [[ -n $SYS ]] && break 30 | done 31 | 32 | for ((int = 0; int < ${#REGEX[@]}; int++)); do 33 | [[ $(echo "$SYS" | tr '[:upper:]' '[:lower:]') =~ ${REGEX[int]} ]] && SYSTEM="${RELEASE[int]}" && [[ -n $SYSTEM ]] && break 34 | done 35 | 36 | [[ -z $SYSTEM ]] && red "不支持VPS的当前系统,请使用主流的操作系统" && exit 1 37 | 38 | curr=$(pwd) 39 | 40 | checkvirt(){ 41 | case "$(systemd-detect-virt)" in 42 | openvz) echo "" ;; 43 | * ) red "脚本仅支持OpenVZ虚拟化架构的VPS启用TUN模块!" && exit 1 ;; 44 | esac 45 | } 46 | 47 | checkTUN(){ 48 | TUNStatus=1 49 | TUN=$(cat /dev/net/tun 2>&1 | tr '[:upper:]' '[:lower:]') 50 | [[ ! $TUN =~ 'in bad state' ]] && [[ ! $TUN =~ '处于错误状态' ]] && [[ ! $TUN =~ 'Die Dateizugriffsnummer ist in schlechter Verfassung' ]] && TUNStatus=0 51 | } 52 | 53 | openTUN(){ 54 | checkTUN 55 | if [[ $TUNStatus == 1 ]]; then 56 | red "检测到目前VPS已经启用TUN模块,无需重复启用" 57 | fi 58 | if [[ $TUNStatus == 0 ]]; then 59 | yellow "检测到VPS虚拟化架构为OpenVZ,正在尝试使用脚本启用TUN" 60 | cd /dev 61 | mkdir net 62 | mknod net/tun c 10 200 63 | chmod 0666 net/tun 64 | sleep 2 65 | checkTUN 66 | if [[ $TUNStatus == 1 ]]; then 67 | green "OpenVZ VPS的TUN模块已启用成功!" 68 | cd $curr && rm -f tun.sh 69 | else 70 | red "在OpenVZ VPS尝试开启TUN模块失败,请到VPS控制面板处开启" 71 | cd $curr && rm -f tun.sh 72 | exit 1 73 | fi 74 | cat < /usr/bin/tun.sh 75 | #!/bin/bash 76 | # Generated by Script: mikupeto/warp-script 77 | cd /dev 78 | mkdir net 79 | mknod net/tun c 10 200 80 | chmod 0666 net/tun 81 | EOF 82 | chmod +x /usr/bin/tun.sh 83 | grep -qE "^ *@reboot root bash /usr/bin/tun.sh >/dev/null 2>&1" /etc/crontab || echo "@reboot root bash /usr/bin/tun.sh >/dev/null 2>&1" >> /etc/crontab 84 | fi 85 | } 86 | 87 | checkvirt 88 | openTUN -------------------------------------------------------------------------------- /files/wgcf/wgcf-fetchlog.txt: -------------------------------------------------------------------------------- 1 | # wgcf fetch log generated by GitHub Actions 2 | Last Version: v2.2.25 3 | Fetch Date: Tue Mar 11 13:02:04 UTC 2025 4 | -------------------------------------------------------------------------------- /files/wgcf/wgcf-latest-linux-amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wgcf/wgcf-latest-linux-amd64 -------------------------------------------------------------------------------- /files/wgcf/wgcf-latest-linux-arm64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wgcf/wgcf-latest-linux-arm64 -------------------------------------------------------------------------------- /files/wgcf/wgcf-latest-linux-s390x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wgcf/wgcf-latest-linux-s390x -------------------------------------------------------------------------------- /files/wireguard-go/wireguard-go-amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wireguard-go/wireguard-go-amd64 -------------------------------------------------------------------------------- /files/wireguard-go/wireguard-go-arm64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wireguard-go/wireguard-go-arm64 -------------------------------------------------------------------------------- /files/wireguard-go/wireguard-go-s390x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wireguard-go/wireguard-go-s390x -------------------------------------------------------------------------------- /files/wireproxy/wireproxy-fetchlog.txt: -------------------------------------------------------------------------------- 1 | # wireproxy fetch log generated by GitHub Actions 2 | Last Version: v1.0.9 3 | Fetch Date: Tue Mar 11 12:17:04 UTC 2025 4 | -------------------------------------------------------------------------------- /files/wireproxy/wireproxy-latest-linux-amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wireproxy/wireproxy-latest-linux-amd64 -------------------------------------------------------------------------------- /files/wireproxy/wireproxy-latest-linux-arm64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wireproxy/wireproxy-latest-linux-arm64 -------------------------------------------------------------------------------- /files/wireproxy/wireproxy-latest-linux-s390x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikupeto/warp-script/27e7fd851010922b315d35acd75716f1ab99b93d/files/wireproxy/wireproxy-latest-linux-s390x -------------------------------------------------------------------------------- /files/wp-plus.py: -------------------------------------------------------------------------------- 1 | import urllib.request 2 | import json 3 | import datetime 4 | import random 5 | import string 6 | import time 7 | import os 8 | import sys 9 | os.system("title WARP-PLUS-CLOUDFLARE By ALIILAPRO") 10 | os.system('cls' if os.name == 'nt' else 'clear') 11 | print(' _______ _ __________________ _______ _______ _______ _______\n' 12 | ' ( ___ | \ \__ __|__ __( \ ( ___ | ____ | ____ | ___ )\n' 13 | ' | ( ) | ( ) ( ) ( | ( | ( ) | ( )| ( )| ( ) |\n' 14 | ' | (___) | | | | | | | | | (___) | (____)| (____)| | | |\n' 15 | ' | ___ | | | | | | | | | ___ | _____) __) | | |\n' 16 | ' | ( ) | | | | | | | | | ( ) | ( | (\ ( | | | |\n' 17 | ' | ) ( | (____/\__) (_____) (__| (____/\ ) ( | ) | ) \ \_| (___) |\n' 18 | ' |/ \(_______|_______|_______(_______// \|/ |/ \__(_______)\n') 19 | print ("[+] ABOUT SCRIPT:") 20 | print ("[-] With this script, you can getting unlimited GB on Warp+.") 21 | print ("[-] Version: 4.0.0") 22 | print ("--------") 23 | print ("[+] THIS SCRIPT CODDED BY ALIILAPRO") 24 | print ("[-] SITE: aliilapro.github.io") 25 | print ("[-] TELEGRAM: aliilapro") 26 | print ("--------") 27 | referrer = input("[#] Enter the WARP+ ID:") 28 | def genString(stringLength): 29 | try: 30 | letters = string.ascii_letters + string.digits 31 | return ''.join(random.choice(letters) for i in range(stringLength)) 32 | except Exception as error: 33 | print(error) 34 | def digitString(stringLength): 35 | try: 36 | digit = string.digits 37 | return ''.join((random.choice(digit) for i in range(stringLength))) 38 | except Exception as error: 39 | print(error) 40 | url = f'https://api.cloudflareclient.com/v0a{digitString(3)}/reg' 41 | def run(): 42 | try: 43 | install_id = genString(22) 44 | body = {"key": "{}=".format(genString(43)), 45 | "install_id": install_id, 46 | "fcm_token": "{}:APA91b{}".format(install_id, genString(134)), 47 | "referrer": referrer, 48 | "warp_enabled": False, 49 | "tos": datetime.datetime.now().isoformat()[:-3] + "+02:00", 50 | "type": "Android", 51 | "locale": "es_ES"} 52 | data = json.dumps(body).encode('utf8') 53 | headers = {'Content-Type': 'application/json; charset=UTF-8', 54 | 'Host': 'api.cloudflareclient.com', 55 | 'Connection': 'Keep-Alive', 56 | 'Accept-Encoding': 'gzip', 57 | 'User-Agent': 'okhttp/3.12.1' 58 | } 59 | req = urllib.request.Request(url, data, headers) 60 | response = urllib.request.urlopen(req) 61 | status_code = response.getcode() 62 | return status_code 63 | except Exception as error: 64 | print(error) 65 | 66 | g = 0 67 | b = 0 68 | while True: 69 | result = run() 70 | if result == 200: 71 | g = g + 1 72 | os.system('cls' if os.name == 'nt' else 'clear') 73 | print("") 74 | print(" WARP-PLUS-CLOUDFLARE (script)" + " By ALIILAPRO") 75 | print("") 76 | animation = ["[■□□□□□□□□□] 10%","[■■□□□□□□□□] 20%", "[■■■□□□□□□□] 30%", "[■■■■□□□□□□] 40%", "[■■■■■□□□□□] 50%", "[■■■■■■□□□□] 60%", "[■■■■■■■□□□] 70%", "[■■■■■■■■□□] 80%", "[■■■■■■■■■□] 90%", "[■■■■■■■■■■] 100%"] 77 | for i in range(len(animation)): 78 | time.sleep(0.5) 79 | sys.stdout.write("\r[+] Preparing... " + animation[i % len(animation)]) 80 | sys.stdout.flush() 81 | print(f"\n[-] WORK ON ID: {referrer}") 82 | print(f"[:)] {g} GB has been successfully added to your account.") 83 | print(f"[#] Total: {g} Good {b} Bad") 84 | print("[*] After 18 seconds, a new request will be sent.") 85 | time.sleep(18) 86 | else: 87 | b = b + 1 88 | os.system('cls' if os.name == 'nt' else 'clear') 89 | print("") 90 | print(" WARP-PLUS-CLOUDFLARE (script)" + " By ALIILAPRO") 91 | print("") 92 | print("[:(] Error when connecting to server.") 93 | print(f"[#] Total: {g} Good {b} Bad") 94 | -------------------------------------------------------------------------------- /warp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LANG=en_US.UTF-8 4 | 5 | RED="\033[31m" 6 | GREEN="\033[32m" 7 | YELLOW="\033[33m" 8 | PLAIN="\033[0m" 9 | 10 | red(){ 11 | echo -e "\033[31m\033[01m$1\033[0m" 12 | } 13 | 14 | green(){ 15 | echo -e "\033[32m\033[01m$1\033[0m" 16 | } 17 | 18 | yellow(){ 19 | echo -e "\033[33m\033[01m$1\033[0m" 20 | } 21 | 22 | REGEX=("debian" "ubuntu" "centos|red hat|kernel|oracle linux|alma|rocky" "'amazon linux'" "fedora") 23 | RELEASE=("Debian" "Ubuntu" "CentOS" "CentOS" "Fedora") 24 | PACKAGE_UPDATE=("apt-get update" "apt-get update" "yum -y update" "yum -y update" "yum -y update") 25 | PACKAGE_INSTALL=("apt -y install" "apt -y install" "yum -y install" "yum -y install" "yum -y install") 26 | PACKAGE_REMOVE=("apt -y remove" "apt -y remove" "yum -y remove" "yum -y remove" "yum -y remove") 27 | PACKAGE_UNINSTALL=("apt -y autoremove" "apt -y autoremove" "yum -y autoremove" "yum -y autoremove" "yum -y autoremove") 28 | 29 | [[ $EUID -ne 0 ]] && red "注意: 请在root用户下运行脚本" && exit 1 30 | 31 | CMD=("$(grep -i pretty_name /etc/os-release 2>/dev/null | cut -d \" -f2)" "$(hostnamectl 2>/dev/null | grep -i system | cut -d : -f2)" "$(lsb_release -sd 2>/dev/null)" "$(grep -i description /etc/lsb-release 2>/dev/null | cut -d \" -f2)" "$(grep . /etc/redhat-release 2>/dev/null)" "$(grep . /etc/issue 2>/dev/null | cut -d \\ -f1 | sed '/^[ ]*$/d')") 32 | 33 | for i in "${CMD[@]}"; do 34 | SYS="$i" && [[ -n $SYS ]] && break 35 | done 36 | 37 | for ((int = 0; int < ${#REGEX[@]}; int++)); do 38 | [[ $(echo "$SYS" | tr '[:upper:]' '[:lower:]') =~ ${REGEX[int]} ]] && SYSTEM="${RELEASE[int]}" && [[ -n $SYSTEM ]] && break 39 | done 40 | 41 | [[ -z $SYSTEM ]] && red "目前脚本暂未支持 ${SYS} 系统!" && exit 1 42 | 43 | wg1="sed -i '/0\.0\.0\.0\/0/d' /etc/wireguard/wgcf.conf" 44 | wg2="sed -i '/\:\:\/0/d' /etc/wireguard/wgcf.conf" 45 | # Wgcf Endpoint 46 | wg3="sed -i 's/engage.cloudflareclient.com/162.159.193.10/g' /etc/wireguard/wgcf.conf" 47 | wg4="sed -i 's/engage.cloudflareclient.com/[2606:4700:d0::a29f:c001]/g' /etc/wireguard/wgcf.conf" 48 | # Wgcf DNS Servers 49 | wg5="sed -i 's/1.1.1.1/1.1.1.1,1.0.0.1,8.8.8.8,8.8.4.4,2606:4700:4700::1111,2606:4700:4700::1001,2001:4860:4860::8888,2001:4860:4860::8844/g' /etc/wireguard/wgcf.conf" 50 | wg6="sed -i 's/1.1.1.1/2606:4700:4700::1111,2606:4700:4700::1001,2001:4860:4860::8888,2001:4860:4860::8844,1.1.1.1,1.0.0.1,8.8.8.8,8.8.4.4/g' /etc/wireguard/wgcf.conf" 51 | # Wgcf 允许外部IP地址 52 | wg7='sed -i "7 s/^/PostUp = ip -4 rule add from $(ip route get 1.1.1.1 | grep -oP '"'src \K\S+') lookup main\n/"'" /etc/wireguard/wgcf.conf && sed -i "7 s/^/PostDown = ip -4 rule delete from $(ip route get 1.1.1.1 | grep -oP '"'src \K\S+') lookup main\n/"'" /etc/wireguard/wgcf.conf' 53 | wg8='sed -i "7 s/^/PostUp = ip -6 rule add from $(ip route get 2606:4700:4700::1111 | grep -oP '"'src \K\S+') lookup main\n/"'" /etc/wireguard/wgcf.conf && sed -i "7 s/^/PostDown = ip -6 rule delete from $(ip route get 2606:4700:4700::1111 | grep -oP '"'src \K\S+') lookup main\n/"'" /etc/wireguard/wgcf.conf' 54 | wg9='sed -i "7 s/^/PostUp = ip -4 rule add from $(ip route get 1.1.1.1 | grep -oP '"'src \K\S+') lookup main\n/"'" /etc/wireguard/wgcf.conf && sed -i "7 s/^/PostDown = ip -4 rule delete from $(ip route get 1.1.1.1 | grep -oP '"'src \K\S+') lookup main\n/"'" /etc/wireguard/wgcf.conf && sed -i "7 s/^/PostUp = ip -6 rule add from $(ip route get 2606:4700:4700::1111 | grep -oP '"'src \K\S+') lookup main\n/"'" /etc/wireguard/wgcf.conf && sed -i "7 s/^/PostDown = ip -6 rule delete from $(ip route get 2606:4700:4700::1111 | grep -oP '"'src \K\S+') lookup main\n/"'" /etc/wireguard/wgcf.conf' 55 | 56 | main=$(uname -r | awk -F . '{print $1}') 57 | minor=$(uname -r | awk -F . '{print $2}') 58 | VERID=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1) 59 | VIRT=$(systemd-detect-virt) 60 | TUN=$(cat /dev/net/tun 2>&1 | tr '[:upper:]' '[:lower:]') 61 | 62 | if [[ -z $(type -P curl) ]]; then 63 | if [[ ! $SYSTEM == "CentOS" ]]; then 64 | ${PACKAGE_UPDATE[int]} 65 | fi 66 | ${PACKAGE_INSTALL[int]} curl 67 | fi 68 | 69 | archAffix(){ 70 | case "$(uname -m)" in 71 | x86_64 | amd64 ) echo 'amd64' ;; 72 | armv8 | arm64 | aarch64 ) echo 'arm64' ;; 73 | s390x ) echo 's390x' ;; 74 | * ) red "脚本暂不不支持 $(uname -m) 架构!" && exit 1 ;; 75 | esac 76 | } 77 | 78 | checkstack(){ 79 | lan4=$(ip route get 1.1.1.1 2>/dev/null | grep -oP 'src \K\S+') 80 | lan6=$(ip route get 2606:4700:4700::1111 2>/dev/null | grep -oP 'src \K\S+') 81 | if [[ "$lan4" =~ ^([0-9]{1,3}\.){3} ]]; then 82 | ping -c2 -W3 1.1.1.1 >/dev/null 2>&1 && out4=1 83 | fi 84 | if [[ "$lan6" != "::1" && "$lan6" =~ ^([a-f0-9]{1,4}:){2,4}[a-f0-9]{1,4} ]]; then 85 | ping6 -c2 -w10 2606:4700:4700::1111 >/dev/null 2>&1 && out6=1 86 | fi 87 | } 88 | 89 | checkwarp(){ 90 | warpv4=$(curl -s4m8 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2) 91 | warpv6=$(curl -s6m8 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2) 92 | } 93 | 94 | checkmtu(){ 95 | yellow "正在检测并设置MTU最佳值, 请稍等..." 96 | checkv4v6 97 | MTUy=1500 98 | MTUc=10 99 | if [[ -n ${v6} && -z ${v4} ]]; then 100 | ping='ping6' 101 | IP1='2606:4700:4700::1001' 102 | IP2='2001:4860:4860::8888' 103 | else 104 | ping='ping' 105 | IP1='1.1.1.1' 106 | IP2='8.8.8.8' 107 | fi 108 | while true; do 109 | if ${ping} -c1 -W1 -s$((${MTUy} - 28)) -Mdo ${IP1} >/dev/null 2>&1 || ${ping} -c1 -W1 -s$((${MTUy} - 28)) -Mdo ${IP2} >/dev/null 2>&1; then 110 | MTUc=1 111 | MTUy=$((${MTUy} + ${MTUc})) 112 | else 113 | MTUy=$((${MTUy} - ${MTUc})) 114 | if [[ ${MTUc} = 1 ]]; then 115 | break 116 | fi 117 | fi 118 | if [[ ${MTUy} -le 1360 ]]; then 119 | MTUy='1360' 120 | break 121 | fi 122 | done 123 | MTU=$((${MTUy} - 80)) 124 | sed -i "s/MTU.*/MTU = $MTU/g" wgcf-profile.conf 125 | green "MTU 最佳值=$MTU 已设置完毕" 126 | } 127 | 128 | checktun(){ 129 | if [[ ! $TUN =~ "in bad state"|"处于错误状态"|"ist in schlechter Verfassung" ]]; then 130 | if [[ $VIRT == lxc ]]; then 131 | if [[ $main -lt 5 ]] || [[ $minor -lt 6 ]]; then 132 | red "检测到目前VPS未开启TUN模块, 请到后台控制面板处开启" 133 | exit 1 134 | else 135 | return 0 136 | fi 137 | elif [[ $VIRT == "openvz" ]]; then 138 | wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/mikupeto/warp-script/files/tun.sh && bash tun.sh 139 | else 140 | red "检测到目前VPS未开启TUN模块, 请到后台控制面板处开启" 141 | exit 1 142 | fi 143 | fi 144 | } 145 | 146 | checkv4v6(){ 147 | ipv4=$(curl -s4m8 api.ipify.org) 148 | ipv6=$(curl -s6m8 api64.ipify.org) 149 | } 150 | 151 | initwgcf(){ 152 | wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/mikupeto/warp-script/files/wgcf/wgcf-latest-linux-$(archAffix) -O /usr/local/bin/wgcf 153 | chmod +x /usr/local/bin/wgcf 154 | } 155 | 156 | wgcfreg(){ 157 | if [[ -f /etc/wireguard/wgcf-account.toml ]]; then 158 | cp -f /etc/wireguard/wgcf-account.toml /root/wgcf-account.toml 159 | fi 160 | 161 | until [[ -a wgcf-account.toml ]]; do 162 | yellow "正在向CloudFlare WARP注册账号, 如提示429 Too Many Requests错误请耐心等待脚本重试注册即可" 163 | wgcf register --accept-tos 164 | sleep 5 165 | done 166 | chmod +x wgcf-account.toml 167 | 168 | wgcf generate 169 | chmod +x wgcf-profile.conf 170 | } 171 | 172 | wgcfv4(){ 173 | checkwarp 174 | if [[ $warpv4 =~ on|plus ]] || [[ $warpv6 =~ on|plus ]]; then 175 | wg-quick down wgcf >/dev/null 2>&1 176 | checkstack 177 | wg-quick up wgcf >/dev/null 2>&1 178 | else 179 | checkstack 180 | fi 181 | 182 | if [[ -n $lan4 && -n $out4 && -z $lan6 && -z $out6 ]]; then 183 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 184 | yellow "检测为纯IPv4的VPS,正在切换为Wgcf-WARP全局单栈模式 (WARP IPv4)" 185 | wgcf1=$wg5 && wgcf2=$wg7 && wgcf3=$wg2 && wgcf4=$wg3 186 | switchconf 187 | else 188 | yellow "检测为纯IPv4的VPS,正在安装Wgcf-WARP全局单栈模式 (WARP IPv4)" 189 | wgcf1=$wg5 && wgcf2=$wg7 && wgcf3=$wg2 && wgcf4=$wg3 190 | installwgcf 191 | fi 192 | elif [[ -z $lan4 && -z $out4 && -n $lan6 && -n $out6 ]]; then 193 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 194 | yellow "检测为纯IPv6的VPS,正在切换为Wgcf-WARP全局单栈模式 (WARP IPv4 + 原生 IPv6)" 195 | wgcf1=$wg6 && wgcf2=$wg2 && wgcf3=$wg4 196 | switchconf 197 | else 198 | yellow "检测为纯IPv6的VPS,正在安装Wgcf-WARP全局单栈模式 (WARP IPv4 + 原生 IPv6)" 199 | wgcf1=$wg6 && wgcf2=$wg2 && wgcf3=$wg4 200 | installwgcf 201 | fi 202 | elif [[ -n $lan4 && -n $out4 && -n $lan6 && -n $out6 ]]; then 203 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 204 | yellow "检测为原生双栈的VPS,正在切换为Wgcf-WARP全局单栈模式 (WARP IPv4 + 原生 IPv6)" 205 | wgcf1=$wg5 && wgcf2=$wg7 && wgcf3=$wg2 206 | switchconf 207 | else 208 | yellow "检测为原生双栈的VPS,正在安装Wgcf-WARP全局单栈模式 (WARP IPv4 + 原生 IPv6)" 209 | wgcf1=$wg5 && wgcf2=$wg7 && wgcf3=$wg2 210 | installwgcf 211 | fi 212 | elif [[ -n $lan4 && -z $out4 && -n $lan6 && -n $out6 ]]; then 213 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 214 | yellow "检测为NAT IPv4+原生 IPv6的VPS,正在切换为Wgcf-WARP全局单栈模式 (WARP IPv4 + 原生 IPv6)" 215 | wgcf1=$wg6 && wgcf2=$wg7 && wgcf3=$wg2 && wgcf4=$wg4 216 | switchconf 217 | else 218 | yellow "检测为NAT IPv4+原生IPv6的VPS,正在安装Wgcf-WARP全局单栈模式 (WARP IPv4 + 原生 IPv6)" 219 | wgcf1=$wg6 && wgcf2=$wg7 && wgcf3=$wg2 && wgcf4=$wg4 220 | installwgcf 221 | fi 222 | fi 223 | } 224 | 225 | wgcfv6(){ 226 | checkwarp 227 | if [[ $warpv4 =~ on|plus ]] || [[ $warpv6 =~ on|plus ]]; then 228 | wg-quick down wgcf >/dev/null 2>&1 229 | checkstack 230 | wg-quick up wgcf >/dev/null 2>&1 231 | else 232 | checkstack 233 | fi 234 | 235 | if [[ -n $lan4 && -n $out4 && -z $lan6 && -z $out6 ]]; then 236 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 237 | yellow "检测为纯IPv4的VPS,正在切换为Wgcf-WARP全局单栈模式 (原生IPv4 + WARP IPv6)" 238 | wgcf1=$wg5 && wgcf2=$wg1 && wgcf3=$wg3 239 | switchconf 240 | else 241 | yellow "检测为纯IPv4的VPS,正在安装Wgcf-WARP全局单栈模式 (原生IPv4 + WARP IPv6)" 242 | wgcf1=$wg5 && wgcf2=$wg1 && wgcf3=$wg3 243 | installwgcf 244 | fi 245 | elif [[ -z $lan4 && -z $out4 && -n $lan6 && -n $out6 ]]; then 246 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 247 | yellow "检测为纯IPv6的VPS,正在切换为Wgcf-WARP全局单栈模式 (WARP IPv6)" 248 | wgcf1=$wg6 && wgcf2=$wg8 && wgcf3=$wg1 && wgcf4=$wg4 249 | switchconf 250 | else 251 | yellow "检测为纯IPv6的VPS,正在安装Wgcf-WARP全局单栈模式 (WARP IPv6)" 252 | wgcf1=$wg6 && wgcf2=$wg8 && wgcf3=$wg1 && wgcf4=$wg4 253 | installwgcf 254 | fi 255 | elif [[ -n $lan4 && -n $out4 && -n $lan6 && -n $out6 ]]; then 256 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 257 | yellow "检测为原生双栈的VPS,正在切换为Wgcf-WARP全局单栈模式 (原生 IPv4 + WARP IPv6)" 258 | wgcf1=$wg5 && wgcf2=$wg8 && wgcf3=$wg1 259 | switchconf 260 | else 261 | yellow "检测为原生双栈的VPS,正在安装Wgcf-WARP全局单栈模式 (原生 IPv4 + WARP IPv6)" 262 | wgcf1=$wg5 && wgcf2=$wg8 && wgcf3=$wg1 263 | installwgcf 264 | fi 265 | elif [[ -n $lan4 && -z $out4 && -n $lan6 && -n $out6 ]]; then 266 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 267 | yellow "检测为NAT IPv4+原生 IPv6的VPS,正在切换为Wgcf-WARP全局单栈模式 (WARP IPv6)" 268 | wgcf1=$wg6 && wgcf2=$wg9 && wgcf3=$wg1 && wgcf4=$wg4 269 | switchconf 270 | else 271 | yellow "检测为NAT IPv4+原生 IPv6的VPS,正在安装Wgcf-WARP全局单栈模式 (WARP IPv6)" 272 | wgcf1=$wg6 && wgcf2=$wg9 && wgcf3=$wg1 && wgcf4=$wg4 273 | installwgcf 274 | fi 275 | fi 276 | } 277 | 278 | wgcfv46(){ 279 | checkwarp 280 | if [[ $warpv4 =~ on|plus ]] || [[ $warpv6 =~ on|plus ]]; then 281 | wg-quick down wgcf >/dev/null 2>&1 282 | checkstack 283 | wg-quick up wgcf >/dev/null 2>&1 284 | else 285 | checkstack 286 | fi 287 | 288 | if [[ -n $lan4 && -n $out4 && -z $lan6 && -z $out6 ]]; then 289 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 290 | yellow "检测为纯IPv4的VPS,正在切换为Wgcf-WARP全局双栈模式 (WARP IPv4 + WARP IPv6)" 291 | wgcf1=$wg5 && wgcf2=$wg7 && wgcf3=$wg3 292 | switchconf 293 | else 294 | yellow "检测为纯IPv4的VPS,正在安装Wgcf-WARP全局双栈模式 (WARP IPv4 + WARP IPv6)" 295 | wgcf1=$wg5 && wgcf2=$wg7 && wgcf3=$wg3 296 | installwgcf 297 | fi 298 | elif [[ -z $lan4 && -z $out4 && -n $lan6 && -n $out6 ]]; then 299 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 300 | yellow "检测为纯IPv6的VPS,正在切换为Wgcf-WARP全局双栈模式 (WARP IPv4 + WARP IPv6)" 301 | wgcf1=$wg6 && wgcf2=$wg8 && wgcf3=$wg4 302 | switchconf 303 | else 304 | yellow "检测为纯IPv6的VPS,正在安装Wgcf-WARP全局双栈模式 (WARP IPv4 + WARP IPv6)" 305 | wgcf1=$wg6 && wgcf2=$wg8 && wgcf3=$wg4 306 | installwgcf 307 | fi 308 | elif [[ -n $lan4 && -n $out4 && -n $lan6 && -n $out6 ]]; then 309 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 310 | yellow "检测为原生双栈的VPS,正在切换为Wgcf-WARP全局单栈模式 (WARP IPv4 + WARP IPv6)" 311 | wgcf1=$wg5 && wgcf2=$wg9 312 | switchconf 313 | else 314 | yellow "检测为原生双栈的VPS,正在安装Wgcf-WARP全局双栈模式 (WARP IPv4 + WARP IPv6)" 315 | wgcf1=$wg5 && wgcf2=$wg9 316 | installwgcf 317 | fi 318 | elif [[ -n $lan4 && -z $out4 && -n $lan6 && -n $out6 ]]; then 319 | if [[ -n $(type -P wg-quick) && -n $(type -P wgcf) ]]; then 320 | yellow "检测为NAT IPv4+原生 IPv6的VPS,正在切换为Wgcf-WARP全局双栈模式 (WARP IPv4 + WARP IPv6)" 321 | wgcf1=$wg6 && wgcf2=$wg9 && wgcf3=$wg4 322 | switchconf 323 | else 324 | yellow "检测为NAT IPv4+原生 IPv6的VPS,正在安装Wgcf-WARP全局双栈模式 (WARP IPv4 + WARP IPv6)" 325 | wgcf1=$wg6 && wgcf2=$wg9 && wgcf3=$wg4 326 | installwgcf 327 | fi 328 | fi 329 | } 330 | 331 | wgcfconf(){ 332 | echo $wgcf1 | sh 333 | echo $wgcf2 | sh 334 | echo $wgcf3 | sh 335 | echo $wgcf4 | sh 336 | } 337 | 338 | installwgcf(){ 339 | checktun 340 | 341 | if [[ $SYSTEM == "CentOS" ]]; then 342 | ${PACKAGE_INSTALL[int]} epel-release 343 | ${PACKAGE_INSTALL[int]} sudo curl wget iproute net-tools wireguard-tools iptables bc htop screen python3 iputils qrencode 344 | fi 345 | if [[ $SYSTEM == "Fedora" ]]; then 346 | ${PACKAGE_INSTALL[int]} sudo curl wget iproute net-tools wireguard-tools iptables bc htop screen python3 iputils qrencode 347 | fi 348 | if [[ $SYSTEM == "Debian" ]]; then 349 | ${PACKAGE_UPDATE[int]} 350 | ${PACKAGE_INSTALL[int]} sudo wget curl lsb-release bc htop screen python3 inetutils-ping qrencode 351 | echo "deb http://deb.debian.org/debian $(lsb_release -sc)-backports main" | tee /etc/apt/sources.list.d/backports.list 352 | ${PACKAGE_UPDATE[int]} 353 | ${PACKAGE_INSTALL[int]} --no-install-recommends net-tools iproute2 openresolv dnsutils wireguard-tools iptables 354 | fi 355 | if [[ $SYSTEM == "Ubuntu" ]]; then 356 | ${PACKAGE_UPDATE[int]} 357 | ${PACKAGE_INSTALL[int]} sudo curl wget lsb-release bc htop screen python3 inetutils-ping qrencode 358 | ${PACKAGE_INSTALL[int]} --no-install-recommends net-tools iproute2 openresolv dnsutils wireguard-tools iptables 359 | fi 360 | 361 | if [[ $main -lt 5 ]] || [[ $minor -lt 6 ]] || [[ $VIRT =~ lxc|openvz ]]; then 362 | wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/mikupeto/warp-script/files/wireguard-go/wireguard-go-$(archAffix) -O /usr/bin/wireguard-go 363 | chmod +x /usr/bin/wireguard-go 364 | fi 365 | 366 | initwgcf 367 | wgcfreg 368 | checkmtu 369 | 370 | if [[ ! -d "/etc/wireguard" ]]; then 371 | mkdir /etc/wireguard 372 | fi 373 | 374 | cp -f wgcf-profile.conf /etc/wireguard/wgcf.conf >/dev/null 2>&1 375 | mv -f wgcf-profile.conf /etc/wireguard/wgcf-profile.conf >/dev/null 2>&1 376 | mv -f wgcf-account.toml /etc/wireguard/wgcf-account.toml >/dev/null 2>&1 377 | 378 | wgcfconf 379 | checkwgcf 380 | } 381 | 382 | switchconf(){ 383 | wg-quick down wgcf >/dev/null 2>&1 384 | 385 | rm -rf /etc/wireguard/wgcf.conf 386 | cp -f /etc/wireguard/wgcf-profile.conf /etc/wireguard/wgcf.conf 387 | 388 | wgcfconf 389 | checkwgcf 390 | } 391 | 392 | checkwgcf(){ 393 | yellow "正在启动 Wgcf-WARP" 394 | i=0 395 | while [ $i -le 4 ]; do let i++ 396 | wg-quick down wgcf >/dev/null 2>&1 397 | wg-quick up wgcf >/dev/null 2>&1 398 | checkwarp 399 | if [[ $warpv4 =~ on|plus ]] || [[ $warpv6 =~ on|plus ]]; then 400 | systemctl enable wg-quick@wgcf >/dev/null 2>&1 401 | green "Wgcf-WARP 已启动成功!" 402 | check_status 403 | show_status 404 | break 405 | else 406 | red "Wgcf-WARP 启动失败!" 407 | fi 408 | checkwarp 409 | if [[ ! $warpv4 =~ on|plus && ! $warpv6 =~ on|plus ]]; then 410 | red "安装Wgcf-WARP失败!" 411 | green "建议如下:" 412 | yellow "1. 建议使用官方源升级系统及内核加速!如已使用第三方源及内核加速,请务必更新到最新版,或重置为官方源" 413 | yellow "2. 部分VPS系统极度精简,相关依赖需自行安装后再尝试" 414 | yellow "3. 查看https://www.cloudflarestatus.com/,如当前VPS区域可能处于【Re-routed】状态时,代表你的VPS无法使用Wgcf-WARP" 415 | yellow "4. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 416 | exit 1 417 | fi 418 | done 419 | } 420 | 421 | switchwgcf(){ 422 | green "请选择以下选项:" 423 | echo -e " ${GREEN}1.${PLAIN} 重启 Wgcf-WARP" 424 | echo -e " ${GREEN}2.${PLAIN} 启动 Wgcf-WARP" 425 | echo -e " ${GREEN}3.${PLAIN} 停止 Wgcf-WARP" 426 | read -rp "请输入选项:" answerwgcf 427 | if [[ $answerwgcf == 1 ]]; then 428 | checkwgcf 429 | elif [[ $answerwgcf == 2 ]]; then 430 | checkwgcf 431 | elif [[ $answerwgcf == 3 ]]; then 432 | wg-quick down wgcf >/dev/null 2>&1 433 | systemctl disable wg-quick@wgcf >/dev/null 2>&1 434 | green "Wgcf-WARP 已停止成功!" 435 | fi 436 | } 437 | 438 | unstwgcf(){ 439 | wg-quick down wgcf 2>/dev/null 440 | systemctl disable wg-quick@wgcf 2>/dev/null 441 | ${PACKAGE_UNINSTALL[int]} wireguard-tools wireguard-dkms 442 | if [[ -z $(type -P wireproxy) ]]; then 443 | rm -f /usr/local/bin/wgcf 444 | rm -f /etc/wireguard/wgcf-account.toml 445 | fi 446 | rm -f /etc/wireguard/wgcf.conf 447 | rm -f /usr/bin/wireguard-go 448 | if [[ -e /etc/gai.conf ]]; then 449 | sed -i '/^precedence[ ]*::ffff:0:0\/96[ ]*100/d' /etc/gai.conf 450 | fi 451 | green "Wgcf-WARP 已彻底卸载成功!" 452 | } 453 | 454 | installcli(){ 455 | [[ $SYSTEM == "CentOS" ]] && [[ ! ${VERID} =~ 8 ]] && yellow "当前系统版本:${CMD} \nWARP-Cli代理模式仅支持CentOS / Almalinux / Rocky / Oracle Linux 8系统" && exit 1 456 | [[ $SYSTEM == "Debian" ]] && [[ ! ${VERID} =~ 9|10|11 ]] && yellow "当前系统版本:${CMD} \nWARP-Cli代理模式仅支持Debian 9-11系统" && exit 1 457 | [[ $SYSTEM == "Fedora" ]] && yellow "当前系统版本:${CMD} \nWARP-Cli暂时不支持Fedora系统" && exit 1 458 | [[ $SYSTEM == "Ubuntu" ]] && [[ ! ${VERID} =~ 16|18|20|22 ]] && yellow "当前系统版本:${CMD} \nWARP-Cli代理模式仅支持Ubuntu 16.04/18.04/20.04/22.04系统" && exit 1 459 | 460 | [[ ! $(archAffix) == "amd64" ]] && red "WARP-Cli暂时不支持目前VPS的CPU架构, 请使用CPU架构为amd64的VPS" && exit 1 461 | 462 | checktun 463 | 464 | checkwarp 465 | if [[ $warpv4 =~ on|plus ]] ||[[ $warpv6 =~ on|plus ]]; then 466 | wg-quick down wgcf >/dev/null 2>&1 467 | checkv4v6 468 | wg-quick up wgcf >/dev/null 2>&1 469 | else 470 | checkv4v6 471 | fi 472 | 473 | if [[ -z $ipv4 ]]; then 474 | red "WARP-Cli暂时不支持纯IPv6的VPS,退出安装!" 475 | exit 1 476 | fi 477 | 478 | if [[ $SYSTEM == "CentOS" ]]; then 479 | ${PACKAGE_INSTALL[int]} epel-release 480 | ${PACKAGE_INSTALL[int]} sudo curl wget net-tools bc htop iputils screen python3 qrencode 481 | rpm -ivh http://pkg.cloudflareclient.com/cloudflare-release-el8.rpm 482 | ${PACKAGE_INSTALL[int]} cloudflare-warp 483 | fi 484 | 485 | if [[ $SYSTEM == "Debian" ]]; then 486 | ${PACKAGE_UPDATE[int]} 487 | ${PACKAGE_INSTALL[int]} sudo curl wget lsb-release bc htop inetutils-ping screen python3 qrencode 488 | [[ -z $(type -P gpg 2>/dev/null) ]] && ${PACKAGE_INSTALL[int]} gnupg 489 | [[ -z $(apt list 2>/dev/null | grep apt-transport-https | grep installed) ]] && ${PACKAGE_INSTALL[int]} apt-transport-https 490 | curl https://pkg.cloudflareclient.com/pubkey.gpg | apt-key add - 491 | echo "deb http://pkg.cloudflareclient.com/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/cloudflare-client.list 492 | ${PACKAGE_UPDATE[int]} 493 | ${PACKAGE_INSTALL[int]} cloudflare-warp 494 | fi 495 | 496 | if [[ $SYSTEM == "Ubuntu" ]]; then 497 | ${PACKAGE_UPDATE[int]} 498 | ${PACKAGE_INSTALL[int]} sudo curl wget lsb-release bc htop inetutils-ping screen python3 qrencode 499 | curl https://pkg.cloudflareclient.com/pubkey.gpg | apt-key add - 500 | echo "deb http://pkg.cloudflareclient.com/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/cloudflare-client.list 501 | ${PACKAGE_UPDATE[int]} 502 | ${PACKAGE_INSTALL[int]} cloudflare-warp 503 | fi 504 | 505 | warp-cli --accept-tos register >/dev/null 2>&1 506 | if [[ $warpcli == 1 ]]; then 507 | yellow "正在启动 WARP-Cli IPv4网卡出口模式" 508 | warp-cli --accept-tos add-excluded-route 0.0.0.0/0 >/dev/null 2>&1 509 | warp-cli --accept-tos add-excluded-route ::0/0 >/dev/null 2>&1 510 | warp-cli --accept-tos set-mode warp >/dev/null 2>&1 511 | warp-cli --accept-tos connect >/dev/null 2>&1 512 | warp-cli --accept-tos enable-always-on >/dev/null 2>&1 513 | sleep 5 514 | ip -4 rule add from 172.16.0.2 lookup 51820 515 | ip -4 route add default dev CloudflareWARP table 51820 516 | ip -4 rule add table main suppress_prefixlength 0 517 | IPv4=$(curl -s4m8 api.ipify.org --interface CloudflareWARP) 518 | retry_time=0 519 | until [[ -n $IPv4 ]]; do 520 | retry_time=$((${retry_time} + 1)) 521 | red "启动 WARP-Cli IPv4网卡出口模式失败,正在尝试重启,重试次数:$retry_time" 522 | warp-cli --accept-tos disconnect >/dev/null 2>&1 523 | warp-cli --accept-tos disable-always-on >/dev/null 2>&1 524 | ip -4 rule delete from 172.16.0.2 lookup 51820 525 | ip -4 rule delete table main suppress_prefixlength 0 526 | sleep 2 527 | warp-cli --accept-tos connect >/dev/null 2>&1 528 | warp-cli --accept-tos enable-always-on >/dev/null 2>&1 529 | sleep 5 530 | ip -4 rule add from 172.16.0.2 lookup 51820 531 | ip -4 route add default dev CloudflareWARP table 51820 532 | ip -4 rule add table main suppress_prefixlength 0 533 | if [[ $retry_time == 6 ]]; then 534 | warp-cli --accept-tos disconnect >/dev/null 2>&1 535 | warp-cli --accept-tos disable-always-on >/dev/null 2>&1 536 | ip -4 rule delete from 172.16.0.2 lookup 51820 537 | ip -4 rule delete table main suppress_prefixlength 0 538 | uninstallcli 539 | red "由于WARP-Cli IPv4网卡出口模式启动重试次数过多 ,已自动卸载WARP-Cli IPv4网卡出口模式" 540 | green "建议如下:" 541 | yellow "1. 建议使用系统官方源升级系统及内核加速!如已使用第三方源及内核加速 ,请务必更新到最新版 ,或重置为系统官方源!" 542 | yellow "2. 部分VPS系统过于精简 ,相关依赖需自行安装后再重试" 543 | yellow "3. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 544 | exit 1 545 | fi 546 | done 547 | green "WARP-Cli IPv4网卡出口模式已安装成功!" 548 | check_status 549 | show_status 550 | fi 551 | 552 | if [[ $warpcli == 2 ]]; then 553 | read -rp "请输入WARP-Cli使用的代理端口 (默认随机端口): " WARPCliPort 554 | [[ -z $WARPCliPort ]] && WARPCliPort=$(shuf -i 1000-65535 -n 1) 555 | if [[ -n $(ss -ntlp | awk '{print $4}' | grep -w "$WARPCliPort") ]]; then 556 | until [[ -z $(ss -ntlp | awk '{print $4}' | grep -w "$WARPCliPort") ]]; do 557 | if [[ -n $(ss -ntlp | awk '{print $4}' | grep -w "$WARPCliPort") ]]; then 558 | yellow "你设置的端口目前已被占用,请重新输入端口" 559 | read -rp "请输入WARP-Cli使用的代理端口 (默认随机端口): " WARPCliPort 560 | fi 561 | done 562 | fi 563 | yellow "正在启动 WARP-Cli 代理模式" 564 | warp-cli --accept-tos set-mode proxy >/dev/null 2>&1 565 | warp-cli --accept-tos set-proxy-port "$WARPCliPort" >/dev/null 2>&1 566 | warp-cli --accept-tos connect >/dev/null 2>&1 567 | warp-cli --accept-tos enable-always-on >/dev/null 2>&1 568 | sleep 2 569 | if [[ ! $(ss -nltp) =~ 'warp-svc' ]]; then 570 | red "由于WARP-Cli代理模式安装失败 ,已自动卸载WARP-Cli代理模式" 571 | green "建议如下:" 572 | yellow "1. 建议使用系统官方源升级系统及内核加速!如已使用第三方源及内核加速 ,请务必更新到最新版 ,或重置为系统官方源!" 573 | yellow "2. 部分VPS系统过于精简 ,相关依赖需自行安装后再重试" 574 | yellow "3. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 575 | exit 1 576 | else 577 | green "WARP-Cli 代理模式已启动成功!" 578 | check_status 579 | show_status 580 | fi 581 | fi 582 | } 583 | 584 | warpcli_changeport() { 585 | if [[ $(warp-cli --accept-tos status) =~ Connected ]]; then 586 | warp-cli --accept-tos disconnect >/dev/null 2>&1 587 | fi 588 | 589 | read -rp "请输入WARP-Cli使用的代理端口 (默认随机端口): " WARPCliPort 590 | [[ -z $WARPCliPort ]] && WARPCliPort=$(shuf -i 1000-65535 -n 1) 591 | if [[ -n $(ss -ntlp | awk '{print $4}' | grep -w "$WARPCliPort") ]]; then 592 | until [[ -z $(ss -ntlp | awk '{print $4}' | grep -w "$WARPCliPort") ]]; do 593 | if [[ -n $(ss -ntlp | awk '{print $4}' | grep -w "$WARPCliPort") ]]; then 594 | yellow "你设置的端口目前已被占用,请重新输入端口" 595 | read -rp "请输入WARP-Cli使用的代理端口 (默认随机端口): " WARPCliPort 596 | fi 597 | done 598 | fi 599 | warp-cli --accept-tos set-proxy-port "$WARPCliPort" >/dev/null 2>&1 600 | 601 | yellow "正在启动Warp-Cli代理模式" 602 | warp-cli --accept-tos connect >/dev/null 2>&1 603 | warp-cli --accept-tos enable-always-on >/dev/null 2>&1 604 | 605 | if [[ ! $(ss -nltp) =~ 'warp-svc' ]]; then 606 | red "WARP-Cli代理模式启动失败!" 607 | exit 1 608 | else 609 | green "WARP-Cli代理模式已启动成功并成功修改代理端口!" 610 | fi 611 | } 612 | 613 | switchcli(){ 614 | green "请选择以下选项:" 615 | echo -e " ${GREEN}1.${PLAIN} 重启 Wgcf-WARP" 616 | echo -e " ${GREEN}2.${PLAIN} 启动 Wgcf-WARP" 617 | echo -e " ${GREEN}3.${PLAIN} 停止 Wgcf-WARP" 618 | read -rp "请输入选项:" answerwgcf 619 | if [[ $answerwgcf == 1 ]]; then 620 | yellow "正在重启Warp-Cli" 621 | warp-cli --accept-tos disconnect >/dev/null 2>&1 622 | warp-cli --accept-tos connect >/dev/null 2>&1 623 | warp-cli --accept-tos enable-always-on >/dev/null 2>&1 624 | green "WARP-Cli客户端已重启成功! " 625 | elif [[ $answerwgcf == 2 ]]; then 626 | yellow "正在启动Warp-Cli" 627 | warp-cli --accept-tos connect >/dev/null 2>&1 628 | warp-cli --accept-tos enable-always-on >/dev/null 2>&1 629 | green "WARP-Cli客户端已启动成功! " 630 | elif [[ $answerwgcf == 3 ]]; then 631 | warp-cli --accept-tos disconnect >/dev/null 2>&1 632 | green "WARP-Cli客户端已停止成功!" 633 | fi 634 | } 635 | 636 | uninstallcli(){ 637 | warp-cli --accept-tos disconnect >/dev/null 2>&1 638 | warp-cli --accept-tos disable-always-on >/dev/null 2>&1 639 | warp-cli --accept-tos delete >/dev/null 2>&1 640 | ${PACKAGE_UNINSTALL[int]} cloudflare-warp 641 | systemctl disable --now warp-svc >/dev/null 2>&1 642 | green "WARP-Cli客户端已彻底卸载成功!" 643 | } 644 | 645 | installWireProxy(){ 646 | if [[ $SYSTEM == "CentOS" ]]; then 647 | ${PACKAGE_INSTALL[int]} sudo curl wget bc htop iputils screen python3 qrencode 648 | else 649 | ${PACKAGE_UPDATE[int]} 650 | ${PACKAGE_INSTALL[int]} sudo curl wget bc htop inetutils-ping screen python3 qrencode 651 | fi 652 | 653 | wget https://cdn.jsdelivr.net/gh/mikupeto/warp-script/files/wireproxy/wireproxy-latest-linux-$(archAffix) -O /usr/local/bin/wireproxy 654 | chmod +x /usr/local/bin/wireproxy 655 | 656 | initwgcf 657 | wgcfreg 658 | 659 | checkwarp 660 | 661 | if [[ $warpv4 =~ on|plus ]] || [[ $warpv6 =~ on|plus ]]; then 662 | wg-quick down wgcf >/dev/null 2>&1 663 | checkmtu 664 | checkv4v6 665 | wg-quick up wgcf >/dev/null 2>&1 666 | else 667 | checkmtu 668 | checkv4v6 669 | fi 670 | 671 | read -rp "请输入WireProxy-WARP使用的代理端口 (默认随机端口): " WireProxyPort 672 | [[ -z $WireProxyPort ]] && WireProxyPort=$(shuf -i 1000-65535 -n 1) 673 | if [[ -n $(ss -ntlp | awk '{print $4}' | grep -w "$WireProxyPort") ]]; then 674 | until [[ -z $(ss -ntlp | awk '{print $4}' | grep -w "$WireProxyPort") ]]; do 675 | if [[ -n $(ss -ntlp | awk '{print $4}' | grep -w "$WireProxyPort") ]]; then 676 | yellow "你设置的端口目前已被占用,请重新输入端口" 677 | read -rp "请输入WireProxy-WARP使用的代理端口 (默认随机端口): " WireProxyPort 678 | fi 679 | done 680 | fi 681 | 682 | WgcfPrivateKey=$(grep PrivateKey wgcf-profile.conf | sed "s/PrivateKey = //g") 683 | WgcfPublicKey=$(grep PublicKey wgcf-profile.conf | sed "s/PublicKey = //g") 684 | 685 | if [[ -z $ipv4 && -n $ipv6 ]]; then 686 | WireproxyEndpoint="[2606:4700:d0::a29f:c001]:2408" 687 | else 688 | WireproxyEndpoint="162.159.193.10:2408" 689 | fi 690 | 691 | if [[ ! -d "/etc/wireguard" ]]; then 692 | mkdir /etc/wireguard 693 | fi 694 | 695 | cat < /etc/wireguard/proxy.conf 696 | [Interface] 697 | Address = 172.16.0.2/32 698 | MTU = $MTU 699 | PrivateKey = $WgcfPrivateKey 700 | DNS = 1.1.1.1,1.0.0.1,8.8.8.8,8.8.4.4,2606:4700:4700::1001,2606:4700:4700::1111,2001:4860:4860::8888,2001:4860:4860::8844 701 | [Peer] 702 | PublicKey = $WgcfPublicKey 703 | Endpoint = $WireproxyEndpoint 704 | [Socks5] 705 | BindAddress = 127.0.0.1:$WireProxyPort 706 | EOF 707 | 708 | cat <<'TEXT' > /etc/systemd/system/wireproxy-warp.service 709 | [Unit] 710 | Description=CloudFlare WARP Socks5 proxy mode based for WireProxy, script by mikupeto 711 | After=network.target 712 | [Install] 713 | WantedBy=multi-user.target 714 | [Service] 715 | Type=simple 716 | WorkingDirectory=/root 717 | ExecStart=/usr/local/bin/wireproxy -c /etc/wireguard/proxy.conf 718 | Restart=always 719 | TEXT 720 | 721 | mv -f wgcf-profile.conf /etc/wireguard/wgcf-profile.conf 722 | mv -f wgcf-account.toml /etc/wireguard/wgcf-account.toml 723 | 724 | yellow "正在启动 WireProxy-WARP 代理模式" 725 | systemctl start wireproxy-warp 726 | WireProxyStatus=$(curl -sx socks5h://localhost:$WireProxyPort https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 727 | sleep 2 728 | retry_time=0 729 | until [[ $WireProxyStatus =~ on|plus ]]; do 730 | retry_time=$((${retry_time} + 1)) 731 | red "启动 WireProxy-WARP 代理模式失败,正在尝试重启,重试次数:$retry_time" 732 | systemctl stop wireproxy-warp 733 | systemctl start wireproxy-warp 734 | WireProxyStatus=$(curl -sx socks5h://localhost:$WireProxyPort https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 735 | if [[ $retry_time == 6 ]]; then 736 | uninstallWireProxy 737 | echo "" 738 | red "由于 WireProxy-WARP 代理模式启动重试次数过多 ,已自动卸载 WireProxy-WARP 代理模式" 739 | green "建议如下:" 740 | yellow "1. 建议使用系统官方源升级系统及内核加速!如已使用第三方源及内核加速 ,请务必更新到最新版 ,或重置为系统官方源!" 741 | yellow "2. 部分VPS系统过于精简 ,相关依赖需自行安装后再重试" 742 | yellow "3. 检查 https://www.cloudflarestatus.com/ 查询VPS就近区域。如处于黄色的【Re-routed】状态则不可使用WireProxy-WARP 代理模式" 743 | yellow "4. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 744 | exit 1 745 | fi 746 | sleep 8 747 | done 748 | sleep 5 749 | systemctl enable wireproxy-warp >/dev/null 2>&1 750 | green "WireProxy-WARP 代理模式已启动成功!" 751 | check_status 752 | show_status 753 | } 754 | 755 | wireproxy_changeport(){ 756 | systemctl stop wireproxy-warp 757 | read -rp "请输入WireProxy-WARP使用的代理端口 (默认随机端口): " WireProxyPort 758 | [[ -z $WireProxyPort ]] && WireProxyPort=$(shuf -i 1000-65535 -n 1) 759 | if [[ -n $(netstat -ntlp | grep "$WireProxyPort") ]]; then 760 | until [[ -z $(netstat -ntlp | grep "$WireProxyPort") ]]; do 761 | if [[ -n $(netstat -ntlp | grep "$WireProxyPort") ]]; then 762 | yellow "你设置的端口目前已被占用,请重新输入端口" 763 | read -rp "请输入WireProxy-WARP使用的代理端口 (默认随机端口): " WireProxyPort 764 | fi 765 | done 766 | fi 767 | CurrentPort=$(grep BindAddress /etc/wireguard/proxy.conf) 768 | sed -i "s/$CurrentPort/BindAddress = 127.0.0.1:$WireProxyPort/g" /etc/wireguard/proxy.conf 769 | yellow "正在启动 WireProxy-WARP 代理模式" 770 | systemctl start wireproxy-warp 771 | WireProxyStatus=$(curl -sx socks5h://localhost:$WireProxyPort https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 772 | retry_time=0 773 | until [[ $WireProxyStatus =~ on|plus ]]; do 774 | retry_time=$((${retry_time} + 1)) 775 | red "启动 WireProxy-WARP 代理模式失败,正在尝试重启,重试次数:$retry_time" 776 | systemctl stop wireproxy-warp 777 | systemctl start wireproxy-warp 778 | WireProxyStatus=$(curl -sx socks5h://localhost:$WireProxyPort https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 779 | if [[ $retry_time == 6 ]]; then 780 | uninstallWireProxy 781 | echo "" 782 | red "由于 WireProxy-WARP 代理模式启动重试次数过多 ,已自动卸载 WireProxy-WARP 代理模式" 783 | green "建议如下:" 784 | yellow "1. 建议使用系统官方源升级系统及内核加速!如已使用第三方源及内核加速 ,请务必更新到最新版 ,或重置为系统官方源!" 785 | yellow "2. 部分VPS系统过于精简 ,相关依赖需自行安装后再重试" 786 | yellow "3. 检查 https://www.cloudflarestatus.com/ 查询VPS就近区域。如处于黄色的【Re-routed】状态则不可使用WireProxy-WARP 代理模式" 787 | yellow "4. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 788 | exit 1 789 | fi 790 | sleep 8 791 | done 792 | systemctl enable wireproxy-warp 793 | green "WireProxy-WARP 代理模式已启动成功并已修改端口!" 794 | echo "" 795 | showIP 796 | } 797 | 798 | switchWireproxy(){ 799 | green "请选择以下选项:" 800 | echo -e " ${GREEN}1.${PLAIN} 重启 Wgcf-WARP" 801 | echo -e " ${GREEN}2.${PLAIN} 启动 Wgcf-WARP" 802 | echo -e " ${GREEN}3.${PLAIN} 停止 Wgcf-WARP" 803 | read -rp "请输入选项:" answerwgcf 804 | if [[ $answerwgcf == 1 ]]; then 805 | yellow "正在重启WireProxy-WARP" 806 | systemctl restart wireproxy-warp 807 | green "WireProxy-WARP客户端已重启成功!" 808 | elif [[ $answerwgcf == 2 ]]; then 809 | yellow "正在启动WireProxy-WARP" 810 | systemctl start wireproxy-warp 811 | systemctl enable wireproxy-warp 812 | green "WireProxy-WARP客户端已启动成功!" 813 | elif [[ $answerwgcf == 3 ]]; then 814 | systemctl stop wireproxy-warp 815 | systemctl disable wireproxy-warp 816 | green "WireProxy-WARP客户端已停止成功!" 817 | fi 818 | } 819 | 820 | uninstallWireProxy(){ 821 | systemctl stop wireproxy-warp 822 | systemctl disable wireproxy-warp 823 | rm -f /etc/systemd/system/wireproxy-warp.service /usr/local/bin/wireproxy /etc/wireguard/proxy.conf 824 | if [[ ! -f /etc/wireguard/wgcf.conf ]]; then 825 | rm -f /usr/local/bin/wgcf /etc/wireguard/wgcf-account.toml 826 | fi 827 | green "WireProxy-WARP代理模式已彻底卸载成功!" 828 | } 829 | 830 | 831 | wgfile(){ 832 | yellow "请选择将要生成的配置文件的网络环境:" 833 | green "1. IPv4 (默认)" 834 | green "2. IPv6" 835 | read -rp "请输入选项 [1-2]:" netInput 836 | case $netInput in 837 | 1) endpointip="162.159.193.10" ;; 838 | 2) endpointip="[2606:4700:d0::]" ;; 839 | *) endpointip="162.159.193.10" ;; 840 | esac 841 | cp -f /etc/wireguard/wgcf.conf /root/wgcf-proxy.conf 842 | sed -i '/PostUp/d;/PostDown/d;/AllowedIPs/d;/Endpoint/d' /root/wgcf-proxy.conf 843 | sed -i "8a AllowedIPs = 0.0.0.0\/0\nAllowedIPs = ::\/0\n" /root/wgcf-proxy.conf 844 | sed -i "10a Endpoint = $endpointip:1701" /root/wgcf-proxy.conf 845 | green "Wgcf-WARP的WireGuard配置文件已提取成功!" 846 | yellow "文件已保存至:/root/wgcf-proxy.conf" 847 | yellow "WireGuard 节点配置二维码如下所示:" 848 | qrencode -t ansiutf8 < /root/wgcf-proxy.conf 849 | } 850 | 851 | warpup(){ 852 | yellow "获取CloudFlare WARP账号信息方法: " 853 | green "电脑: 下载并安装CloudFlare WARP→设置→偏好设置→复制设备ID到脚本中" 854 | green "手机: 下载并安装1.1.1.1 APP→菜单→高级→诊断→复制设备ID到脚本中" 855 | echo "" 856 | yellow "请按照下面指示, 输入您的CloudFlare WARP账号信息:" 857 | read -rp "请输入您的WARP设备ID (36位字符): " license 858 | until [[ $license =~ ^[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{12}$ ]]; do 859 | red "设备ID输入格式输入错误,请重新输入!" 860 | read -rp "请输入您的WARP设备ID (36位字符): " license 861 | done 862 | wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/mikupeto/warp-script/files/wp-plus.py 863 | sed -i "27 s/[(][^)]*[)]//g" wp-plus.py 864 | sed -i "27 s/input/'$license'/" wp-plus.py 865 | read -rp "请输入Screen会话名称 (默认为wp-plus): " screenname 866 | [[ -z $screenname ]] && screenname="wp-plus" 867 | screen -UdmS $screenname bash -c '/usr/bin/python3 /root/wp-plus.py' 868 | green "创建刷WARP+流量任务成功! Screen会话名称为:$screenname" 869 | } 870 | 871 | warpsw1(){ 872 | yellow "请选择切换的账户类型" 873 | green "1. WARP 免费账户" 874 | green "2. WARP+" 875 | green "3. WARP Teams (Zero Trust)" 876 | read -rp "请选择账户类型 [1-3]: " accountInput 877 | if [[ $accountInput == 1 ]]; then 878 | if [[ -n $(type -P wgcf) && -n $(type -P wg-quick) ]]; then 879 | wg-quick down wgcf >/dev/null 2>&1 880 | cd /etc/wireguard 881 | rm -f wgcf-account.toml wgcf-profile.conf 882 | wgcfreg 883 | warpPublicKey=$(grep PublicKey /etc/wireguard/wgcf-profile.conf | sed "s/PublicKey = //g") 884 | warpPrivateKey=$(grep PrivateKey /etc/wireguard/wgcf-profile.conf | sed "s/PrivateKey = //g") 885 | warpIPv4Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 3p | sed "s/Address = //g") 886 | warpIPv6Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 4p | sed "s/Address = //g") 887 | sed -i "s#PublicKey.*#PublicKey = $warpPublicKey#g" /etc/wireguard/wgcf.conf; 888 | sed -i "s#PrivateKey.*#PrivateKey = $warpPrivateKey#g" /etc/wireguard/wgcf.conf; 889 | sed -i "s#Address.*32#Address = $warpIPv4Address#g" /etc/wireguard/wgcf.conf; 890 | sed -i "s#Address.*128#Address = $warpIPv6Address#g" /etc/wireguard/wgcf.conf; 891 | rm -f wgcf-profile.conf 892 | wg-quick up wgcf >/dev/null 2>&1 893 | yellow "正在检查Wgcf-WARP的WARP 免费账户连通性,请稍等..." && sleep 5 894 | checkgbwp 895 | if [[ $gbwpv4 == "on" ]] || [[ $gbwpv6 == "on" ]]; then 896 | green "Wgcf-WARP 账户类型切换为 WARP 免费账户 成功!" 897 | else 898 | wg-quick down wgcf >/dev/null 2>&1 899 | red "切换 Wgcf-WARP 账户类型失败,请尝试卸载后重装以重新切换账户!" 900 | exit 1 901 | fi 902 | fi 903 | if [[ -n $(type -P wireproxy) ]]; then 904 | systemctl stop wireproxy-warp 905 | cd /etc/wireguard 906 | rm -f wgcf-account.toml wgcf-profile.conf 907 | wgcfreg 908 | warpIPv4Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 3p | sed "s/Address = //g") 909 | warpPublicKey=$(grep PublicKey /etc/wireguard/wgcf-profile.conf | sed "s/PublicKey = //g") 910 | warpPrivateKey=$(grep PrivateKey /etc/wireguard/wgcf-profile.conf | sed "s/PrivateKey = //g") 911 | sed -i "s#PublicKey.*#PublicKey = $warpPublicKey#g" /etc/wireguard/proxy.conf; 912 | sed -i "s#PrivateKey.*#PrivateKey = $warpPrivateKey#g" /etc/wireguard/proxy.conf; 913 | sed -i "s#Address.*32#Address = $warpIPv4Address/32#g" /etc/wireguard/proxy.conf; 914 | systemctl start wireproxy-warp 915 | yellow "正在检查WireProxy代理模式的WARP 免费账户连通性,请稍等..." && sleep 5 916 | WireProxyStatus=$(curl -sx socks5h://localhost:$w5p https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 917 | sleep 2 918 | if [[ $WireProxyStatus == "on" ]]; then 919 | green "WireProxy-WARP 代理模式 账户类型切换为 WARP 免费账户 成功!" 920 | else 921 | systemctl stop wireproxy-warp 922 | red "切换 WireProxy-WARP 代理模式账户类型失败,请卸载后重新切换账户!" 923 | exit 1 924 | fi 925 | fi 926 | showIP 927 | fi 928 | if [[ $accountInput == 2 ]]; then 929 | cd /etc/wireguard 930 | if [[ ! -f wgcf-account.toml ]]; then 931 | until [[ -a wgcf-account.toml ]]; do 932 | wgcf register --accept-tos 933 | sleep 5 934 | done 935 | fi 936 | chmod +x wgcf-account.toml 937 | yellow "获取CloudFlare WARP账号密钥信息方法: " 938 | green "电脑: 下载并安装CloudFlare WARP→设置→偏好设置→账户→复制密钥到脚本中" 939 | green "手机: 下载并安装1.1.1.1 APP→菜单→账户→复制密钥到脚本中" 940 | echo "" 941 | yellow "重要:请确保手机或电脑的1.1.1.1 APP的账户状态为WARP+!" 942 | read -rp "输入WARP账户许可证密钥 (26个字符): " warpkey 943 | until [[ -z $warpkey || $warpkey =~ ^[A-Z0-9a-z]{8}-[A-Z0-9a-z]{8}-[A-Z0-9a-z]{8}$ ]]; do 944 | red "WARP账户许可证密钥格式输入错误,请重新输入!" 945 | read -rp "输入WARP账户许可证密钥 (26个字符): " warpkey 946 | done 947 | if [[ -n $warpkey ]]; then 948 | sed -i "s/license_key.*/license_key = \"$warpkey\"/g" wgcf-account.toml 949 | read -rp "请输入自定义设备名,如未输入则使用默认随机设备名: " devicename 950 | rm -f wgcf-profile.conf 951 | green "注册WARP+账户中, 如下方显示:400 Bad Request, 则使用WARP免费版账户" 952 | if [[ -n $devicename ]]; then 953 | wgcf update --name $(echo $devicename | sed s/[[:space:]]/_/g) > /etc/wireguard/info.log 2>&1 954 | else 955 | wgcf update > /etc/wireguard/info.log 2>&1 956 | fi 957 | wgcf generate 958 | chmod +x wgcf-profile.conf 959 | if [[ -n $(type -P wgcf) && -n $(type -P wg-quick) ]]; then 960 | wg-quick down wgcf >/dev/null 2>&1 961 | warpPublicKey=$(grep PublicKey /etc/wireguard/wgcf-profile.conf | sed "s/PublicKey = //g") 962 | warpPrivateKey=$(grep PrivateKey /etc/wireguard/wgcf-profile.conf | sed "s/PrivateKey = //g") 963 | warpIPv4Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 3p | sed "s/Address = //g") 964 | warpIPv6Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 4p | sed "s/Address = //g") 965 | sed -i "s#PublicKey.*#PublicKey = $warpPublicKey#g" /etc/wireguard/wgcf.conf; 966 | sed -i "s#PrivateKey.*#PrivateKey = $warpPrivateKey#g" /etc/wireguard/wgcf.conf; 967 | sed -i "s#Address.*32#Address = $warpIPv4Address#g" /etc/wireguard/wgcf.conf; 968 | sed -i "s#Address.*128#Address = $warpIPv6Address#g" /etc/wireguard/wgcf.conf; 969 | wg-quick up wgcf >/dev/null 2>&1 970 | yellow "正在检查Wgcf-WARP的WARP+账户连通性,请稍等..." && sleep 5 971 | checkgbwp 972 | if [[ $gbwpv4 == "plus" ]] || [[ $gbwpv6 == "plus" ]]; then 973 | green "Wgcf-WARP 账户类型切换为 WARP+ 成功!" 974 | else 975 | wg-quick down wgcf >/dev/null 2>&1 976 | cd /etc/wireguard 977 | rm -f wgcf-account.toml wgcf-profile.conf 978 | until [[ -a wgcf-account.toml ]]; do 979 | wgcf register --accept-tos 980 | sleep 5 981 | done 982 | wgcf generate 983 | chmod +x wgcf-profile.conf 984 | warpPublicKey=$(grep PublicKey /etc/wireguard/wgcf-profile.conf | sed "s/PublicKey = //g") 985 | warpPrivateKey=$(grep PrivateKey /etc/wireguard/wgcf-profile.conf | sed "s/PrivateKey = //g") 986 | warpIPv4Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 3p | sed "s/Address = //g") 987 | warpIPv6Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 4p | sed "s/Address = //g") 988 | sed -i "s#PublicKey.*#PublicKey = $warpPublicKey#g" /etc/wireguard/wgcf.conf; 989 | sed -i "s#PrivateKey.*#PrivateKey = $warpPrivateKey#g" /etc/wireguard/wgcf.conf; 990 | sed -i "s#Address.*32#Address = $warpIPv4Address#g" /etc/wireguard/wgcf.conf; 991 | sed -i "s#Address.*128#Address = $warpIPv6Address#g" /etc/wireguard/wgcf.conf; 992 | wg-quick up wgcf >/dev/null 2>&1 993 | red "切换 Wgcf-WARP 账户类型失败,已自动切换为WARP 免费账户!" 994 | green "建议如下:" 995 | yellow "1. 检查1.1.1.1 APP中的WARP+账户是否有足够的流量,如没有流量可以使用本脚本内的刷流量功能来获取免费的WARP+流量" 996 | yellow "2. 检查当前WARP许可证密钥是否绑定超过5台设备" 997 | yellow "3. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 998 | exit 1 999 | fi 1000 | fi 1001 | if [[ -n $(type -P wireproxy) ]]; then 1002 | systemctl stop wireproxy-warp 1003 | warpIPv4Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 3p | sed "s/Address = //g") 1004 | warpPublicKey=$(grep PublicKey /etc/wireguard/wgcf-profile.conf | sed "s/PublicKey = //g") 1005 | warpPrivateKey=$(grep PrivateKey /etc/wireguard/wgcf-profile.conf | sed "s/PrivateKey = //g") 1006 | sed -i "s#PublicKey.*#PublicKey = $warpPublicKey#g" /etc/wireguard/proxy.conf; 1007 | sed -i "s#PrivateKey.*#PrivateKey = $warpPrivateKey#g" /etc/wireguard/proxy.conf; 1008 | sed -i "s#Address.*32#Address = $warpIPv4Address/32#g" /etc/wireguard/proxy.conf; 1009 | systemctl start wireproxy-warp 1010 | yellow "正在检查WireProxy的WARP+账户连通性,请稍等..." && sleep 5 1011 | WireProxyStatus=$(curl -sx socks5h://localhost:$w5p https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 1012 | sleep 2 1013 | if [[ $WireProxyStatus == "plus" ]]; then 1014 | green "WireProxy-WARP代理模式 账户类型切换为 WARP+ 成功!" 1015 | else 1016 | systemctl stop wireproxy-warp 1017 | cd /etc/wireguard 1018 | rm -f wgcf-account.toml wgcf-profile.conf 1019 | until [[ -a wgcf-account.toml ]]; do 1020 | wgcf register --accept-tos 1021 | sleep 5 1022 | done 1023 | wgcf generate 1024 | chmod +x wgcf-profile.conf 1025 | warpIPv4Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 3p | sed "s/Address = //g") 1026 | warpPublicKey=$(grep PublicKey /etc/wireguard/wgcf-profile.conf | sed "s/PublicKey = //g") 1027 | warpPrivateKey=$(grep PrivateKey /etc/wireguard/wgcf-profile.conf | sed "s/PrivateKey = //g") 1028 | sed -i "s#PublicKey.*#PublicKey = $warpPublicKey#g" /etc/wireguard/proxy.conf; 1029 | sed -i "s#PrivateKey.*#PrivateKey = $warpPrivateKey#g" /etc/wireguard/proxy.conf; 1030 | sed -i "s#Address.*32#Address = $warpIPv4Address/32#g" /etc/wireguard/proxy.conf; 1031 | systemctl start wireproxy-warp 1032 | red "切换 WireProxy-WARP 代理模式账户类型失败,已自动切换为WARP 免费账户!" 1033 | green "建议如下:" 1034 | yellow "1. 检查1.1.1.1 APP中的WARP+账户是否有足够的流量,如没有流量可以使用本脚本内的刷流量功能来获取免费的WARP+流量" 1035 | yellow "2. 检查当前WARP许可证密钥是否绑定超过5台设备" 1036 | yellow "3. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 1037 | exit 1 1038 | fi 1039 | fi 1040 | showIP 1041 | else 1042 | red "未输入WARP账户许可证密钥, 无法升级!" 1043 | fi 1044 | fi 1045 | if [[ $accountInput == 3 ]]; then 1046 | read -rp "请复制粘贴WARP Teams账户配置文件链接 [如未输入则使用脚本默认的]:" teamconfigurl 1047 | if [[ -z $teamconfigurl ]]; then 1048 | yellow "未输入Teams账户配置文件链接,正在使用脚本公用Teams账户..." 1049 | teamconfigurl="https://raw.githubusercontent.com/mikupeto/warp-script/master/files/teams.xml" 1050 | fi 1051 | teamsconfig=$(curl -sSL "$teamconfigurl" | sed "s/\"/\"/g") 1052 | wpteampublickey=$(expr "$teamsconfig" : '.*public_key":"\([^&]*\).*') 1053 | wpteamprivatekey=$(expr "$teamsconfig" : '.*private_key">\([^<]*\).*') 1054 | wpteamv6address=$(expr "$teamsconfig" : '.*v6":"\([^[&]*\).*') 1055 | wpteamv4address=$(expr "$teamsconfig" : '.*v4":"\(172[^&]*\).*') 1056 | green "你的WARP Teams配置文件信息如下:" 1057 | yellow "PublicKey: $wpteampublickey" 1058 | yellow "PrivateKey: $wpteamprivatekey" 1059 | yellow "IPv4地址: $wpteamv4address" 1060 | yellow "IPv6地址: $wpteamv6address" 1061 | read -rp "确认以上配置信息信息正确请输入y, 其他按键退出升级过程: " wpteamconfirm 1062 | if [[ $wpteamconfirm =~ "y"|"Y" ]]; then 1063 | if [[ -n $(type -P wgcf) && -n $(type -P wg-quick) ]]; then 1064 | wg-quick down wgcf >/dev/null 2>&1 1065 | sed -i "s#PublicKey.*#PublicKey = $wpteampublickey#g" /etc/wireguard/wgcf.conf; 1066 | sed -i "s#PrivateKey.*#PrivateKey = $wpteamprivatekey#g" /etc/wireguard/wgcf.conf; 1067 | sed -i "s#Address.*32#Address = $wpteamv4address/32#g" /etc/wireguard/wgcf.conf; 1068 | sed -i "s#Address.*128#Address = $wpteamv6address/128#g" /etc/wireguard/wgcf.conf; 1069 | sed -i "s#PublicKey.*#PublicKey = $wpteampublickey#g" /etc/wireguard/wgcf-profile.conf; 1070 | sed -i "s#PrivateKey.*#PrivateKey = $wpteamprivatekey#g" /etc/wireguard/wgcf-profile.conf; 1071 | sed -i "s#Address.*32#Address = $wpteamv4address/32#g" /etc/wireguard/wgcf-profile.conf; 1072 | sed -i "s#Address.*128#Address = $wpteamv6address/128#g" /etc/wireguard/wgcf-profile.conf; 1073 | wg-quick up wgcf >/dev/null 2>&1 1074 | yellow "正在检查Wgcf-WARP的WARP Teams账户连通性, 请稍等..." 1075 | checkgbwp 1076 | retry_time=1 1077 | until [[ $gbwpv4 =~ on|plus ]] || [[ $gbwpv6 =~ on|plus ]]; do 1078 | red "无法联通WARP Teams账户, 正在尝试重启, 重试次数:$retry_time" 1079 | retry_time=$((${retry_time} + 1)) 1080 | if [[ $retry_time == 4 ]]; then 1081 | wg-quick down wgcf >/dev/null 2>&1 1082 | cd /etc/wireguard 1083 | rm -f wgcf-profile.conf 1084 | wgcf generate 1085 | chmod +x wgcf-profile.conf 1086 | warpPublicKey=$(grep PublicKey /etc/wireguard/wgcf-profile.conf | sed "s/PublicKey = //g") 1087 | warpPrivateKey=$(grep PrivateKey /etc/wireguard/wgcf-profile.conf | sed "s/PrivateKey = //g") 1088 | warpIPv4Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 3p | sed "s/Address = //g") 1089 | warpIPv6Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 4p | sed "s/Address = //g") 1090 | sed -i "s#PublicKey.*#PublicKey = $warpPublicKey#g" /etc/wireguard/wgcf.conf; 1091 | sed -i "s#PrivateKey.*#PrivateKey = $warpPrivateKey#g" /etc/wireguard/wgcf.conf; 1092 | sed -i "s#Address.*32#Address = $warpIPv4Address#g" /etc/wireguard/wgcf.conf; 1093 | sed -i "s#Address.*128#Address = $warpIPv6Address#g" /etc/wireguard/wgcf.conf; 1094 | wg-quick up wgcf >/dev/null 2>&1 1095 | red "WARP Teams配置可能有误, 已自动降级至WARP 免费账户 / WARP+" 1096 | green "建议如下:" 1097 | yellow "1. 检查提取出来的配置文件是否为从安卓5.1模拟器,1.1.1.1 APP 6.9版本的" 1098 | yellow "2. 你有可能修改了团队名、删除了设备" 1099 | yellow "3. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 1100 | exit 1 1101 | fi 1102 | done 1103 | green "Wgcf-WARP 账户类型切换为 WARP Teams 成功!" 1104 | fi 1105 | if [[ -n $(type -P wireproxy) ]]; then 1106 | systemctl stop wireproxy-warp 1107 | sed -i "s#PublicKey.*#PublicKey = $wpteampublickey#g" /etc/wireguard/proxy.conf; 1108 | sed -i "s#PrivateKey.*#PrivateKey = $wpteamprivatekey#g" /etc/wireguard/proxy.conf; 1109 | sed -i "s#Address.*32#Address = $wpteamv4address/32#g" /etc/wireguard/proxy.conf; 1110 | systemctl start wireproxy-warp 1111 | yellow "正在检查WireProxy代理模式的WARP Teams账户连通性, 请稍等..." 1112 | WireProxyStatus=$(curl -sx socks5h://localhost:$w5p https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 1113 | sleep 2 1114 | retry_time=1 1115 | until [[ $WireProxyStatus == "plus" ]]; do 1116 | red "无法联通WARP Teams账户, 正在尝试重启, 重试次数:$retry_time" 1117 | retry_time=$((${retry_time} + 1)) 1118 | if [[ $retry_time == 4 ]]; then 1119 | systemctl stop wireproxy-warp 1120 | cd /etc/wireguard 1121 | rm -f wgcf-profile.conf 1122 | wgcf generate 1123 | chmod +x wgcf-profile.conf 1124 | warpIPv4Address=$(cat /etc/wireguard/wgcf-profile.conf | sed -n 3p | sed "s/Address = //g") 1125 | warpPublicKey=$(grep PublicKey /etc/wireguard/wgcf-profile.conf | sed "s/PublicKey = //g") 1126 | warpPrivateKey=$(grep PrivateKey /etc/wireguard/wgcf-profile.conf | sed "s/PrivateKey = //g") 1127 | sed -i "s#PublicKey.*#PublicKey = $warpPublicKey#g" /etc/wireguard/proxy.conf; 1128 | sed -i "s#PrivateKey.*#PrivateKey = $warpPrivateKey#g" /etc/wireguard/proxy.conf; 1129 | sed -i "s#Address.*32#Address = $warpIPv4Address/32#g" /etc/wireguard/proxy.conf; 1130 | rm -f wgcf-profile.conf 1131 | systemctl start wireproxy-warp 1132 | red "WARP Teams配置可能有误, 已自动降级至WARP 免费账户 / WARP+" 1133 | green "建议如下:" 1134 | yellow "1. 检查提取出来的配置文件是否为从安卓5.1模拟器,1.1.1.1 APP 6.9版本的" 1135 | yellow "2. 你有可能修改了团队名、删除了设备" 1136 | yellow "3. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 1137 | exit 1 1138 | fi 1139 | done 1140 | green "WireProxy-WARP代理模式 账户类型切换为 WARP Teams 成功!" 1141 | fi 1142 | showIP 1143 | else 1144 | red "已退出WARP Teams账号升级过程!" 1145 | fi 1146 | fi 1147 | } 1148 | 1149 | warpsw2(){ 1150 | warp-cli --accept-tos disconnect >/dev/null 2>&1 1151 | warp-cli --accept-tos register >/dev/null 2>&1 1152 | yellow "获取CloudFlare WARP账号密钥信息方法: " 1153 | green "电脑: 下载并安装CloudFlare WARP→设置→偏好设置→账户→复制密钥到脚本中" 1154 | green "手机: 下载并安装1.1.1.1 APP→菜单→账户→复制密钥到脚本中" 1155 | echo "" 1156 | yellow "重要:请确保手机或电脑的1.1.1.1 APP的账户状态为WARP+!" 1157 | read -rp "输入WARP账户许可证密钥 (26个字符): " warpkey 1158 | until [[ -z $warpkey || $warpkey =~ ^[A-Z0-9a-z]{8}-[A-Z0-9a-z]{8}-[A-Z0-9a-z]{8}$ ]]; do 1159 | red "WARP账户许可证密钥输入错误,请重新输入!" 1160 | read -rp "输入WARP账户许可证密钥 (26个字符): " warpkey 1161 | done 1162 | if [[ -n $warpkey ]]; then 1163 | warp-cli --accept-tos set-license "$warpkey" >/dev/null 2>&1 && sleep 1 1164 | fi 1165 | warp-cli --accept-tos set-mode proxy >/dev/null 2>&1 1166 | warp-cli --accept-tos set-proxy-port "$s5p" >/dev/null 2>&1 1167 | warp-cli --accept-tos connect >/dev/null 2>&1 1168 | if [[ $(warp-cli --accept-tos account) =~ Limited ]]; then 1169 | green "WARP-Cli 账户类型切换为 WARP+ 成功!" 1170 | showIP 1171 | else 1172 | red "WARP+账户启用失败, 已自动降级至WARP免费版账户" 1173 | green "建议如下:" 1174 | yellow "1. 检查1.1.1.1 APP中的WARP+账户是否有足够的流量,如没有流量可以使用本脚本内的刷流量功能来获取免费的WARP+流量" 1175 | yellow "2. 检查当前WARP许可证密钥是否绑定超过5台设备" 1176 | yellow "3. 脚本可能跟不上时代, 建议截图发布到GitHub Issues询问" 1177 | fi 1178 | } 1179 | 1180 | warpsw(){ 1181 | green "请选择需要切换账户的客户端:" 1182 | echo -e " ${GREEN}1.${PLAIN} Wgcf-WARP和WireProxy-WARP" 1183 | echo -e " ${GREEN}2.${PLAIN} WARP-Cli ${RED}(目前只支持升级至WARP+)${PLAIN}" 1184 | read -rp "请输入选项:" answerwpsw 1185 | case $answerwpsw in 1186 | 2) warpsw2 ;; 1187 | *) exit 1 ;; 1188 | esac 1189 | } 1190 | 1191 | manage1(){ 1192 | green "请选择以下选项:" 1193 | echo -e " ${GREEN}1.${PLAIN} 安装/切换 Wgcf-WARP 单栈模式 ${YELLOW}(WARP IPv4)${PLAIN}" 1194 | echo -e " ${GREEN}2.${PLAIN} 安装/切换 Wgcf-WARP 单栈模式 ${YELLOW}(WARP IPv6)${PLAIN}" 1195 | echo -e " ${GREEN}3.${PLAIN} 安装/切换 Wgcf-WARP 双栈模式" 1196 | echo -e " ${GREEN}4.${PLAIN} 开启、关闭和重启 Wgcf-WARP" 1197 | echo -e " ${GREEN}5.${PLAIN} ${RED}卸载 Wgcf-WARP${PLAIN}" 1198 | read -rp "请输入选项:" answer1 1199 | case $answer1 in 1200 | 1) wgcfv4 ;; 1201 | 2) wgcfv6 ;; 1202 | 3) wgcfv46 ;; 1203 | 4) switchwgcf ;; 1204 | 5) unstwgcf ;; 1205 | *) exit 1 ;; 1206 | esac 1207 | } 1208 | 1209 | manage2(){ 1210 | green "请选择以下选项:" 1211 | echo -e " ${GREEN}1.${PLAIN} 安装 WARP-Cli 并添加IPv4网卡出口" 1212 | echo -e " ${GREEN}2.${PLAIN} 安装 WARP-Cli 并创建本地Socks5代理" 1213 | echo -e " ${GREEN}3.${PLAIN} 修改 WARP-Cli 本地Socks5代理端口" 1214 | echo -e " ${GREEN}4.${PLAIN} 开启、关闭和重启 WARP-Cli" 1215 | echo -e " ${GREEN}5.${PLAIN} ${RED}卸载 WARP-Cli${PLAIN}" 1216 | read -rp "请输入选项:" answer2 1217 | case $answer2 in 1218 | 1) warpcli=1 && installcli ;; 1219 | 2) warpcli=2 && installcli ;; 1220 | 3) warpcli_changeport ;; 1221 | 4) switchcli ;; 1222 | 5) uninstallcli ;; 1223 | *) exit 1 ;; 1224 | esac 1225 | } 1226 | 1227 | manage3(){ 1228 | green "请选择以下选项:" 1229 | echo -e " ${GREEN}1.${PLAIN} 安装 WireProxy-WARP 并创建本地Socks5代理" 1230 | echo -e " ${GREEN}2.${PLAIN} 修改 WireProxy-WARP 本地Socks5代理端口" 1231 | echo -e " ${GREEN}3.${PLAIN} 开启、关闭和重启 WireProxy-WARP" 1232 | echo -e " ${GREEN}4.${PLAIN} ${RED}卸载 WireProxy-WARP${PLAIN}" 1233 | read -rp "请输入选项:" answer3 1234 | case $answer3 in 1235 | 1) installWireProxy ;; 1236 | 2) wireproxy_changeport ;; 1237 | 3) switchWireproxy ;; 1238 | 4) uninstallWireProxy ;; 1239 | *) exit 1 ;; 1240 | esac 1241 | } 1242 | 1243 | manage4(){ 1244 | green "请选择以下选项:" 1245 | echo -e " ${GREEN}1.${PLAIN} 提取WireGuard配置文件" 1246 | echo -e " ${GREEN}2.${PLAIN} WARP+账户刷流量" 1247 | echo -e " ${GREEN}3.${PLAIN} 切换WARP账户" 1248 | echo -e " ${GREEN}4.${PLAIN} 获取解锁NF的WARP IP" 1249 | read -rp "请输入选项:" answer4 1250 | case $answer4 in 1251 | 1) wgfile ;; 1252 | 2) warpup ;; 1253 | 3) warpsw ;; 1254 | *) exit 1 ;; 1255 | esac 1256 | } 1257 | 1258 | check_status(){ 1259 | yellow "正在获取VPS配置信息,请稍等..." 1260 | checkwarp 1261 | 1262 | stat4="${RED}Not Configured${PLAIN}" 1263 | stat6="${RED}Not Configured${PLAIN}" 1264 | [[ $warpv4 == off ]] && stat4="Normal" 1265 | [[ $warpv6 == off ]] && stat6="Normal" 1266 | [[ $warpv4 == on ]] && stat4="${YELLOW}WARP${PLAIN}" 1267 | [[ $warpv6 == on ]] && stat6="${YELLOW}WARP${PLAIN}" 1268 | [[ $warpv4 == plus ]] && stat4="${GREEN}WARP+${PLAIN}" 1269 | [[ $warpv6 == plus ]] && stat6="${GREEN}WARP+${PLAIN}" 1270 | 1271 | if [[ -n $(type -P warp-cli) ]]; then 1272 | if [[ $(warp-cli --accept-tos settings 2>/dev/null | grep "Mode" | awk -F ": " '{print $2}') == "Warp" ]]; then 1273 | statc=$(curl -s4m8 https://www.cloudflare.com/cdn-cgi/trace -k --interface CloudflareWARP | grep warp | cut -d= -f2) 1274 | [[ $statc == on ]] && stat4="${YELLOW}WARP${PLAIN}" 1275 | [[ $statc == plus ]] && stat6="${GREEN}WARP+${PLAIN}" 1276 | else 1277 | sockport=$(warp-cli --accept-tos settings 2>/dev/null | grep 'WarpProxy on port' | awk -F "port " '{print $2}') 1278 | statc=$(curl -sx socks5h://localhost:$sockport https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 1279 | [[ $statc == on ]] && stat4="${YELLOW}WARP with socks5 mode${PLAIN}" 1280 | [[ $statc == plus ]] && stat6="${GREEN}WARP+ with socks5 mode${PLAIN}" 1281 | fi 1282 | 1283 | [[ $statc == off || -z $statc ]] && statc="${RED}Not Started${PLAIN}" 1284 | fi 1285 | 1286 | if [[ -n $(type -P wireproxy) ]]; then 1287 | sockport=$(grep BindAddress /etc/wireguard/proxy.conf 2>/dev/null | sed "s/BindAddress = 127.0.0.1://g") 1288 | statp=$(curl -sx socks5h://localhost:$sockport https://www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 8 | grep warp | cut -d= -f2) 1289 | [[ $statp == off || -z $statp ]] && statp="${RED}Not Started${PLAIN}" 1290 | [[ $statp == on ]] && stat4="${YELLOW}WARP${PLAIN}" 1291 | [[ $statp == plus ]] && stat6="${GREEN}WARP+${PLAIN}" 1292 | fi 1293 | 1294 | [[ -z $statc ]] && statc="${RED}Not Installed${PLAIN}" 1295 | [[ -z $statp ]] && statp="${RED}Not Installed${PLAIN}" 1296 | 1297 | sleep 5 1298 | } 1299 | 1300 | show_status(){ 1301 | echo " ------------------------------------ " 1302 | echo -e "IPv4: $stat4" 1303 | echo -e "IPv6: $stat6" 1304 | echo -e "WARP-Cli: $statc" 1305 | echo -e "WireProxy: $statp" 1306 | echo " ------------------------------------ " 1307 | } 1308 | 1309 | menu(){ 1310 | check_status 1311 | clear 1312 | yellow " CloudFlare WARP 一键脚本 " 1313 | yellow " by Mikupeto" 1314 | echo "" 1315 | echo " ------------------------------------ " 1316 | echo -e " ${GREEN}1.${PLAIN} 管理 Wgcf-WARP" 1317 | echo -e " ${GREEN}2.${PLAIN} 管理 WARP-Cli" 1318 | echo -e " ${GREEN}3.${PLAIN} 管理 WireProxy-WARP" 1319 | echo -e " ${GREEN}4.${PLAIN} WARP 脚本小工具" 1320 | echo " ------------------------------------ " 1321 | echo -e " ${GREEN}0.${PLAIN} 退出脚本" 1322 | echo "" 1323 | show_status 1324 | echo "" 1325 | read -rp "请输入选项:" answer 1326 | case $answer in 1327 | 1) manage1 ;; 1328 | 2) manage2 ;; 1329 | 3) manage3 ;; 1330 | 4) manage4 ;; 1331 | *) exit 1 ;; 1332 | esac 1333 | } 1334 | 1335 | menu --------------------------------------------------------------------------------