mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-16 14:32:21 +08:00
Create working directory if not exists
This commit is contained in:
parent
fe4b429fc2
commit
84904c5206
|
@ -118,7 +118,6 @@ nfpms:
|
|||
- src: LICENSE
|
||||
dst: /usr/share/licenses/sing-box/LICENSE
|
||||
scripts:
|
||||
postinstall: release/config/postinstall.sh
|
||||
postremove: release/config/postremove.sh
|
||||
source:
|
||||
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())
|
||||
}
|
||||
if workingDir != "" {
|
||||
_, err := os.Stat(workingDir)
|
||||
if err != nil {
|
||||
os.MkdirAll(workingDir, 0o777)
|
||||
}
|
||||
if err := os.Chdir(workingDir); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"listen": "::",
|
||||
"listen_port": 8080,
|
||||
"sniff": true,
|
||||
"network": "tcp",
|
||||
"method": "2022-blake3-aes-128-gcm",
|
||||
"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
|
||||
|
||||
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 cp $PROJECT/release/config/config.json /usr/local/etc/sing-box/config.json
|
||||
sudo cp $DIR/sing-box.service /etc/systemd/system
|
||||
|
|
Loading…
Reference in New Issue
Block a user