Command line switch -paused
This commit is contained in:
parent
944d9c84a0
commit
baa87bc823
@ -201,6 +201,7 @@ var (
|
|||||||
logFile string
|
logFile string
|
||||||
auditEnabled bool
|
auditEnabled bool
|
||||||
verbose bool
|
verbose bool
|
||||||
|
paused bool
|
||||||
noRestart = os.Getenv("STNORESTART") != ""
|
noRestart = os.Getenv("STNORESTART") != ""
|
||||||
noUpgrade = os.Getenv("STNOUPGRADE") != ""
|
noUpgrade = os.Getenv("STNOUPGRADE") != ""
|
||||||
guiAddress = os.Getenv("STGUIADDRESS") // legacy
|
guiAddress = os.Getenv("STGUIADDRESS") // legacy
|
||||||
@ -239,6 +240,7 @@ func main() {
|
|||||||
flag.StringVar(&upgradeTo, "upgrade-to", upgradeTo, "Force upgrade directly from specified URL")
|
flag.StringVar(&upgradeTo, "upgrade-to", upgradeTo, "Force upgrade directly from specified URL")
|
||||||
flag.BoolVar(&auditEnabled, "audit", false, "Write events to audit file")
|
flag.BoolVar(&auditEnabled, "audit", false, "Write events to audit file")
|
||||||
flag.BoolVar(&verbose, "verbose", false, "Print verbose log output")
|
flag.BoolVar(&verbose, "verbose", false, "Print verbose log output")
|
||||||
|
flag.BoolVar(&paused, "paused", false, "Start with all devices paused")
|
||||||
|
|
||||||
flag.Usage = usageFor(flag.CommandLine, usage, fmt.Sprintf(extraUsage, baseDirs["config"]))
|
flag.Usage = usageFor(flag.CommandLine, usage, fmt.Sprintf(extraUsage, baseDirs["config"]))
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
@ -633,6 +635,12 @@ func syncthingMain() {
|
|||||||
m.StartDeadlockDetector(20 * time.Minute)
|
m.StartDeadlockDetector(20 * time.Minute)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if paused {
|
||||||
|
for device := range cfg.Devices() {
|
||||||
|
m.PauseDevice(device)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clear out old indexes for other devices. Otherwise we'll start up and
|
// Clear out old indexes for other devices. Otherwise we'll start up and
|
||||||
// start needing a bunch of files which are nowhere to be found. This
|
// start needing a bunch of files which are nowhere to be found. This
|
||||||
// needs to be changed when we correctly do persistent indexes.
|
// needs to be changed when we correctly do persistent indexes.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user