reinstall.sh 396 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. set -e -o pipefail
  3. if [ -d /usr/local/go ]; then
  4. export PATH="$PATH:/usr/local/go/bin"
  5. fi
  6. DIR=$(dirname "$0")
  7. PROJECT=$DIR/../..
  8. pushd $PROJECT
  9. go install -v -trimpath -ldflags "-s -w -buildid=" -tags with_quic,with_wireguard,with_acme ./cmd/sing-box
  10. popd
  11. sudo systemctl stop sing-box
  12. sudo cp $(go env GOPATH)/bin/sing-box /usr/local/bin/
  13. sudo systemctl start sing-box