Created
December 27, 2020 22:12
-
-
Save jixunmoe/0abdd05edaee1b65953ccce1ccdcbdb8 to your computer and use it in GitHub Desktop.
Scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
OS_ARCH="$(uname -m)" | |
FRP_VER=0.34.3 | |
case "$OS_ARCH" in | |
x86_64) OS_ARCH=amd64 ;; | |
i[36]86) OS_ARCH=386 ;; | |
aarch64) OS_ARCH=arm64 ;; | |
arm*) OS_ARCH=arm ;; | |
*) | |
echo "Unsupported arch: $OS_ARCH" | |
exit 1 | |
;; | |
esac | |
DIR_NAME="frp_${FRP_VER}_linux_${OS_ARCH}" | |
URL="https://github.com/fatedier/frp/releases/download/v${FRP_VER}/frp_${FRP_VER}_linux_${OS_ARCH}.tar.gz" | |
cd /tmp | |
wget -q -O- "$URL" | tar zxf - | |
cd "$DIR_NAME" | |
# systemd 服务文件 | |
sed -i 's#/usr/bin/frp#/opt/frp/frp#' systemd/* | |
cp systemd/* /etc/systemd/system | |
# 复制默认配置文件 | |
mkdir -p /etc/frp | |
cp -n *.ini /etc/frp | |
find /etc/frp -type d -exec chmod 755 {} \; | |
find /etc/frp -type f -exec chmod 644 {} \; | |
chown -R 0:0 /etc/frp | |
# 二进制文件 | |
mkdir -p /opt/frp | |
chmod 755 frps frpc | |
cp frps frpc /opt/frp | |
chown -R 0:0 /opt/frp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment