github.com/sagernet/sing-box@v1.9.0-rc.20/release/local/install.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -e -o pipefail
     4  
     5  if [ -d /usr/local/go ]; then
     6    export PATH="$PATH:/usr/local/go/bin"
     7  fi
     8  
     9  DIR=$(dirname "$0")
    10  PROJECT=$DIR/../..
    11  
    12  pushd $PROJECT
    13  go install -v -trimpath -ldflags "-s -w -buildid=" -tags with_quic,with_wireguard,with_acme ./cmd/sing-box
    14  popd
    15  
    16  sudo cp $(go env GOPATH)/bin/sing-box /usr/local/bin/
    17  sudo mkdir -p /usr/local/etc/sing-box
    18  sudo cp $PROJECT/release/config/config.json /usr/local/etc/sing-box/config.json
    19  sudo cp $DIR/sing-box.service /etc/systemd/system
    20  sudo systemctl daemon-reload