ntp: Add write_to_system service option

This commit is contained in:
世界
2023-03-18 23:01:10 +08:00
parent 99b2ab5526
commit 0558b3fc5c
10 changed files with 166 additions and 38 deletions

View File

@@ -12,13 +12,10 @@ import (
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing/common/bufio"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
"github.com/spf13/cobra"
)
var commandFetchFlagOutbound string
var commandFetch = &cobra.Command{
Use: "fetch",
Short: "Fetch an URL",
@@ -32,7 +29,6 @@ var commandFetch = &cobra.Command{
}
func init() {
commandFetch.Flags().StringVar(&commandFetchFlagOutbound, "outbound", "", "outbound tag")
commandTools.AddCommand(commandFetch)
}
@@ -47,7 +43,7 @@ func fetch(args []string) error {
httpClient = &http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
dialer, err := createDialer(instance, N.NetworkTCP, commandFetchFlagOutbound)
dialer, err := createDialer(instance, network, commandToolsFlagOutbound)
if err != nil {
return nil, err
}