wg-ops/install_cn.sh

46 lines
1.2 KiB
Bash
Raw Normal View History

2021-07-30 23:57:24 +08:00
#!/bin/bash
set -xe
sudo apt update
sudo apt install -y curl wireguard python3
mkdir -p local
2021-07-31 02:32:08 +08:00
mkdir -p local/tunnel
2021-07-30 23:57:24 +08:00
mkdir -p bin
cd bin
2021-07-31 02:51:31 +08:00
rm -rf wg-op-binary
2021-07-30 23:57:24 +08:00
git clone https://gitee.com/kiritow/wg-op-binary
cd wg-op-binary
openssl enc -aes-256-cbc -pbkdf2 -a -d -in bin.01 -out ../udp2raw_amd64
openssl enc -aes-256-cbc -pbkdf2 -a -d -in bin.02 -out ../speederv2_amd64
2021-07-31 02:51:31 +08:00
chmod +x ../udp2raw_amd64
chmod +x ../speederv2_amd64
2021-07-30 23:57:24 +08:00
cd ..
rm -rf wg-op-binary
cd ..
2021-07-31 02:51:31 +08:00
VERIFIED_TUNNEL_HASH="a7ce38b2c30980be4e71c3af8a9c1db8183db349c699fa6f843e67add7e6cca2"
LOCAL_TUNNEL_HASH=$(sha256sum bin/udp2raw_amd64 | awk '{print $1}')
VERIFIED_SPEEDER_HASH="3cf8f6c1e9baa530170368efb8a4bfcd6e75f88c2726ecbf2a75261dd1dd9fd5"
LOCAL_SPEEDER_HASH=$(sha256sum bin/speederv2_amd64 | awk '{print $1}')
if [ "$LOCAL_TUNNEL_HASH" == "$VERIFIED_TUNNEL_HASH" ]
2021-07-30 23:57:24 +08:00
then
2021-07-31 02:51:31 +08:00
echo "[OK] udp2raw hash match: $LOCAL_TUNNEL_HASH"
2021-07-30 23:57:24 +08:00
else
2021-07-31 02:51:31 +08:00
echo "[WARN] udp2raw hash mismatch: $LOCAL_TUNNEL_HASH. Expected: $VERIFIED_TUNNEL_HASH"
2021-07-30 23:57:24 +08:00
fi
2021-07-31 02:51:31 +08:00
if [ "$LOCAL_SPEEDER_HASH" == "$VERIFIED_SPEEDER_HASH" ]
2021-07-30 23:57:24 +08:00
then
2021-07-31 02:51:31 +08:00
echo "[OK] speederv2 hash match: $LOCAL_SPEEDER_HASH"
2021-07-30 23:57:24 +08:00
else
2021-07-31 02:51:31 +08:00
echo "[WARN] speederv2 hash mismatch: $LOCAL_SPEEDER_HASH. Expected: $VERIFIED_SPEEDER_HASH"
2021-07-30 23:57:24 +08:00
fi