mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-25 10:01:30 +00:00
Add linux server scripts
This commit is contained in:
parent
0f7f800e95
commit
9b9b5ebb72
14
release/local/config.json
Normal file
14
release/local/config.json
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"log": {
|
||||
"level": "info"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"type": "shadowsocks",
|
||||
"listen": "::",
|
||||
"listen_port": 8080,
|
||||
"method": "2022-blake3-aes-128-gcm",
|
||||
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
||||
}
|
||||
]
|
||||
}
|
7
release/local/enable.sh
Executable file
7
release/local/enable.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
sudo systemctl enable sing-box
|
||||
sudo systemctl start sing-box
|
||||
sudo journalctl -u sing-box --output cat -f
|
16
release/local/install.sh
Executable file
16
release/local/install.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
DIR=$(dirname "$0")
|
||||
PROJECT=$DIR/../..
|
||||
|
||||
pushd $PROJECT
|
||||
go install -v -trimpath -ldflags "-s -w -buildid=" -tags "no_gvisor" ./cmd/sing-box
|
||||
popd
|
||||
|
||||
sudo cp $(go env GOPATH)/bin/sing-box /usr/local/bin/
|
||||
sudo mkdir -p /usr/local/etc/sing-box
|
||||
sudo cp $DIR/config.json /usr/local/etc/sing-box/config.json
|
||||
sudo cp $DIR/sing-box.service /etc/systemd/system
|
||||
sudo systemctl daemon-reload
|
13
release/local/sing-box.service
Normal file
13
release/local/sing-box.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=sing-box service
|
||||
Documentation=https://sing-box.sagernet.org
|
||||
After=network.target nss-lookup.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/sing-box run -c /usr/local/etc/sing-box/config.json
|
||||
Restart=on-failure
|
||||
RestartSec=10s
|
||||
LimitNOFILE=infinity
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
7
release/local/uninstall.sh
Executable file
7
release/local/uninstall.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
sudo systemctl stop sing-box
|
||||
sudo rm -rf /usr/local/bin/sing-box
|
||||
sudo rm -rf /usr/local/etc/sing-box
|
||||
sudo rm -rf /etc/systemd/system/sing-box.service
|
||||
sudo systemctl daemon-reload
|
18
release/local/update.sh
Executable file
18
release/local/update.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
DIR=$(dirname "$0")
|
||||
PROJECT=$DIR/../..
|
||||
|
||||
pushd $PROJECT
|
||||
git fetch
|
||||
git reset FETCH_HEAD --hard
|
||||
git clean -fdx
|
||||
go install -v -trimpath -ldflags "-s -w -buildid=" -tags "no_gvisor" ./cmd/sing-box
|
||||
popd
|
||||
|
||||
sudo systemctl stop sing-box
|
||||
sudo cp $(go env GOPATH)/bin/sing-box /usr/local/bin/
|
||||
sudo systemctl start sing-box
|
||||
sudo journalctl -u sing-box --output cat -f
|
Loading…
Reference in a new issue