mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 08:31:30 +00:00
Create working directory if not exists
This commit is contained in:
parent
fe4b429fc2
commit
84904c5206
|
@ -118,7 +118,6 @@ nfpms:
|
||||||
- src: LICENSE
|
- src: LICENSE
|
||||||
dst: /usr/share/licenses/sing-box/LICENSE
|
dst: /usr/share/licenses/sing-box/LICENSE
|
||||||
scripts:
|
scripts:
|
||||||
postinstall: release/config/postinstall.sh
|
|
||||||
postremove: release/config/postremove.sh
|
postremove: release/config/postremove.sh
|
||||||
source:
|
source:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
|
@ -40,6 +40,10 @@ func preRun(cmd *cobra.Command, args []string) {
|
||||||
log.SetStdLogger(log.NewFactory(log.Formatter{BaseTime: time.Now(), DisableColors: true}, os.Stderr, nil).Logger())
|
log.SetStdLogger(log.NewFactory(log.Formatter{BaseTime: time.Now(), DisableColors: true}, os.Stderr, nil).Logger())
|
||||||
}
|
}
|
||||||
if workingDir != "" {
|
if workingDir != "" {
|
||||||
|
_, err := os.Stat(workingDir)
|
||||||
|
if err != nil {
|
||||||
|
os.MkdirAll(workingDir, 0o777)
|
||||||
|
}
|
||||||
if err := os.Chdir(workingDir); err != nil {
|
if err := os.Chdir(workingDir); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
"listen": "::",
|
"listen": "::",
|
||||||
"listen_port": 8080,
|
"listen_port": 8080,
|
||||||
"sniff": true,
|
"sniff": true,
|
||||||
|
"network": "tcp",
|
||||||
"method": "2022-blake3-aes-128-gcm",
|
"method": "2022-blake3-aes-128-gcm",
|
||||||
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
"password": "8JCsPssfgS8tiRwiMlhARg=="
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
mkdir -p /var/lib/sing-box
|
|
|
@ -14,7 +14,6 @@ go install -v -trimpath -ldflags "-s -w -buildid=" -tags with_quic,with_wireguar
|
||||||
popd
|
popd
|
||||||
|
|
||||||
sudo cp $(go env GOPATH)/bin/sing-box /usr/local/bin/
|
sudo cp $(go env GOPATH)/bin/sing-box /usr/local/bin/
|
||||||
sudo mkdir -p /var/lib/sing-box
|
|
||||||
sudo mkdir -p /usr/local/etc/sing-box
|
sudo mkdir -p /usr/local/etc/sing-box
|
||||||
sudo cp $PROJECT/release/config/config.json /usr/local/etc/sing-box/config.json
|
sudo cp $PROJECT/release/config/config.json /usr/local/etc/sing-box/config.json
|
||||||
sudo cp $DIR/sing-box.service /etc/systemd/system
|
sudo cp $DIR/sing-box.service /etc/systemd/system
|
||||||
|
|
Loading…
Reference in a new issue