├── README.md
├── vps_deploy.sh
└── wrt_kernel.bin
/README.md:
--------------------------------------------------------------------------------
1 | # VPS_OpenWrt
2 | 
3 | 
4 | 
5 |
6 | This repo helps to deploy OpenWrt onto your VPS.
7 | Hereby thank `ptpt52` for his amazing job: https://github.com/x-wrt
8 |
9 | **Tutorial**
10 |
11 | Youtube Video [in Mandarin]: 📺https://youtu.be/iXhd-h4aVW8
12 |
13 | **Prerequisite**
14 | - **`Ubuntu`** or **`Debian`** (CentOS/Arch Based Not tested)
15 | - **`wget`** installed
16 | probably you don't need this, but if you do, you could run command below to install `wget`:
17 | ```Bash
18 | apt update && apt install -y wget
19 | ```
20 | **Steps**
21 |
22 | 1. Upload OpenWrt firmware(WinSCP or prefer), rename it to `op.img.gz`
23 | 2. Run command line below:
24 | ```Bash
25 | bash -c "$(wget -O- https://git.io/JZOn0)"
26 | ```
27 | If you have problem with https certificate, then try this:
28 |
29 | ```Bash
30 | wget --no-check-certificate -O- https://git.io/JZOn0|bash
31 | ```
32 | **Support Platform :**
33 | - Google Cloud
34 | - Azure
35 | - Vultr
36 | - Virmach
37 | - Racknerd
38 | - Hostdare
39 | - Ali Cloud (Domestic)
40 | - hostEONS
41 | - VMShell
42 | - ...
43 |
44 | **`NOT` Support Platform :**
45 | - Oracle
46 |
--------------------------------------------------------------------------------
/vps_deploy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #====================================================
3 | # System Requirement:Debian 8+/Ubuntu 14.04+
4 | # Author: eSirPlayground
5 | # Dscription: OpenWrt Firmware VPS Deployment
6 | # Version: 0.1
7 | #====================================================
8 | clear
9 | echo "
10 | ____ ____ _____
11 | / __ \/ __ \ / ___/___ ______ _____ _____
12 | / / / / /_/ /_____\__ \/ _ \/ ___/ | / / _ \/ ___/
13 | / /_/ / ____/_____/__/ / __/ / | |/ / __/ /
14 | \____/_/ /____/\___/_/ |___/\___/_/
15 | "
16 |
17 | #Fonts Color
18 | red="\033[31m"
19 | green="\033[32m"
20 | blue="\033[36m"
21 | redBG="\033[41;37m"
22 | none="\033[0m"
23 |
24 |
25 | #Check System
26 | IS_OPENVZ=
27 | if hostnamectl status | grep -q openvz; then
28 | IS_OPENVZ=1
29 | fi
30 |
31 | if [[ $IS_OPENVZ ]]; then
32 | echo
33 | echo -e "你的主机环境为 ${green}OpenVZ${none} ,不支持在此类主机部署,请更换${green}kvm${none}类主机再试"
34 | exit 0
35 | fi
36 |
37 | #Check User
38 | if [ `id -u` -eq 0 ];then
39 | echo -e "${blue}Checking${none}..."
40 | echo
41 | else
42 | echo -e "当前用户不是 ${green}root${none} 用户,请切换到 ${green}root${none} 用户或加上 ${redBG}sudo${none} 后重试"
43 | echo
44 | exit 0
45 | fi
46 |
47 | #Check Firmware
48 | fwfile="./op.img.gz"
49 | if [ -e $fwfile ];then
50 | echo -e "${blue}Deploying${none}..."
51 | echo
52 | cp ./op.img.gz /
53 | else
54 | echo -e "请将gz格式的固件改名为${green} op.img.gz ${none}并上传至当前目录,再运行此脚本。"
55 | exit 0
56 | fi
57 |
58 | #File Preparation
59 | #No Checking MD5
60 | vps_kernel=$(uname -r)
61 | wrt_kernel="wrt_kernel.bin"
62 |
63 | wget --no-check-certificate https://raw.githubusercontent.com/esirplayground/VPS_OpenWrt/main/$wrt_kernel
64 | cp $wrt_kernel /boot/vmlinuz-$vps_kernel
65 |
66 | echo -e "${red}Rebooting${none}..."
67 | reboot
--------------------------------------------------------------------------------
/wrt_kernel.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/esirplayground/VPS_OpenWrt/1de6686b63ce7c25e899ca4ffa2fcd1c391a8f9c/wrt_kernel.bin
--------------------------------------------------------------------------------