#!/bin/bash source /home/shell/util.sh # 安装函数 function install () { if [ "$(ostype)" == "Ubuntu" ]; then apt install build-essential -y else dnf install gcc gcc-c++ -y fi if [ ! -f "/usr/local/go/bin/go" ]; then printInfo "安装GO..." bash /home/shell/golang-install.sh fi source /etc/profile.d/go_lang.sh if [ ! -d "/usr/local/src/go-probe" ]; then git clone https://hub.fastgit.org/ProbeChain/go-probe.git /usr/local/src/go-probe fi cd /usr/local/src/go-probe git branch -a read -p "请选择版本[master]:" version version=${version:-"master"}; if [[ "${version}" != "master" ]]; then git checkout -b origin/release/${version} remotes/origin/release/${version} fi go env -w GOPROXY=https://goproxy.cn go env -w GO111MODULE=auto cd /usr/local/src/go-probe/cmd/gprobe go build tee /etc/profile.d/gprobe.sh<