mirror of
https://github.com/Kiritow/wg-ops.git
synced 2024-03-22 13:11:37 +08:00
update install script
This commit is contained in:
parent
acddaf9135
commit
6d10dd0d55
24
install.sh
24
install.sh
|
@ -2,7 +2,13 @@
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y curl wireguard python3 tmux build-essential
|
sudo apt install -y curl wireguard python3
|
||||||
|
|
||||||
|
. /etc/os-release
|
||||||
|
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||||
|
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add -
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y podman
|
||||||
|
|
||||||
mkdir -p local
|
mkdir -p local
|
||||||
mkdir -p local/tunnel
|
mkdir -p local/tunnel
|
||||||
|
@ -10,8 +16,6 @@ mkdir -p local/tunnel
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
cd bin
|
cd bin
|
||||||
|
|
||||||
gcc -O3 -o w2u ../w2u.c
|
|
||||||
|
|
||||||
curl -vL https://github.com/wangyu-/udp2raw-tunnel/releases/download/20200818.0/udp2raw_binaries.tar.gz -o udp2raw.tgz
|
curl -vL https://github.com/wangyu-/udp2raw-tunnel/releases/download/20200818.0/udp2raw_binaries.tar.gz -o udp2raw.tgz
|
||||||
tar -xvzf udp2raw.tgz udp2raw_amd64
|
tar -xvzf udp2raw.tgz udp2raw_amd64
|
||||||
chmod +x udp2raw_amd64
|
chmod +x udp2raw_amd64
|
||||||
|
@ -23,8 +27,9 @@ chmod +x speederv2_amd64
|
||||||
rm udpspeeder.tgz
|
rm udpspeeder.tgz
|
||||||
|
|
||||||
curl -vL https://github.com/ginuerzh/gost/releases/download/v2.11.1/gost-linux-amd64-2.11.1.gz -o gost.gz
|
curl -vL https://github.com/ginuerzh/gost/releases/download/v2.11.1/gost-linux-amd64-2.11.1.gz -o gost.gz
|
||||||
gzip -d gost.gz
|
gzip -cd gost.gz > gost
|
||||||
chmod +x gost
|
chmod +x gost
|
||||||
|
rm gost.gz
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
@ -57,3 +62,14 @@ then
|
||||||
else
|
else
|
||||||
echo "[WARN] gost hash mismatch: $LOCAL_GOST_HASH. Expected: $VERIFIED_GOST_HASH"
|
echo "[WARN] gost hash mismatch: $LOCAL_GOST_HASH. Expected: $VERIFIED_GOST_HASH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sudo podman build . -f DockerfileBuildEnv -t wg-ops-buildenv
|
||||||
|
sudo podman build . -f DockerfileRunEnv -t wg-ops-runenv
|
||||||
|
|
||||||
|
podman build . -f DockerfileBuildEnv -t wg-ops-buildenv
|
||||||
|
podman build . -f DockerfileRunEnv -t wg-ops-runenv
|
||||||
|
|
||||||
|
CONTAINER_ID=$(podman run --rm -it -v ./bin:/root/bin -d wg-ops-buildenv)
|
||||||
|
podman cp mux.c $CONTAINER_ID:/root/
|
||||||
|
podman exec -it $CONTAINER_ID bash -c "cd /root && gcc -O3 -o bin/mux mux.c"
|
||||||
|
podman stop $CONTAINER_ID
|
||||||
|
|
|
@ -2,7 +2,13 @@
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y curl wireguard python3 tmux build-essential
|
sudo apt install -y curl wireguard python3
|
||||||
|
|
||||||
|
. /etc/os-release
|
||||||
|
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
||||||
|
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add -
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y podman
|
||||||
|
|
||||||
mkdir -p local
|
mkdir -p local
|
||||||
mkdir -p local/tunnel
|
mkdir -p local/tunnel
|
||||||
|
@ -10,8 +16,6 @@ mkdir -p local/tunnel
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
cd bin
|
cd bin
|
||||||
|
|
||||||
gcc -O3 -o w2u ../w2u.c
|
|
||||||
|
|
||||||
rm -rf wg-op-binary
|
rm -rf wg-op-binary
|
||||||
git clone https://gitee.com/kiritow/wg-op-binary
|
git clone https://gitee.com/kiritow/wg-op-binary
|
||||||
cd wg-op-binary
|
cd wg-op-binary
|
||||||
|
@ -57,3 +61,18 @@ then
|
||||||
else
|
else
|
||||||
echo "[WARN] gost hash mismatch: $LOCAL_GOST_HASH. Expected: $VERIFIED_GOST_HASH"
|
echo "[WARN] gost hash mismatch: $LOCAL_GOST_HASH. Expected: $VERIFIED_GOST_HASH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sudo podman build . -f DockerfileCN -t ubuntu-cn:latest
|
||||||
|
sudo podman tag ubuntu-cn:latest ubuntu:latest
|
||||||
|
sudo podman build . -f DockerfileBuildEnv -t wg-ops-buildenv
|
||||||
|
sudo podman build . -f DockerfileRunEnv -t wg-ops-runenv
|
||||||
|
|
||||||
|
podman build . -f DockerfileCN -t ubuntu-cn:latest
|
||||||
|
podman tag ubuntu-cn:latest ubuntu:latest
|
||||||
|
podman build . -f DockerfileBuildEnv -t wg-ops-buildenv
|
||||||
|
podman build . -f DockerfileRunEnv -t wg-ops-runenv
|
||||||
|
|
||||||
|
CONTAINER_ID=$(podman run --rm -it -v ./bin:/root/bin -d wg-ops-buildenv)
|
||||||
|
podman cp mux.c $CONTAINER_ID:/root/
|
||||||
|
podman exec -it $CONTAINER_ID bash -c "cd /root && gcc -O3 -o bin/mux mux.c"
|
||||||
|
podman stop $CONTAINER_ID
|
||||||
|
|
Loading…
Reference in New Issue
Block a user