mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-11 09:10:53 +08:00
moved if/else to correct function
This commit is contained in:
parent
c35aec1eb7
commit
884d1938e6
2 changed files with 22 additions and 22 deletions
|
|
@ -36,7 +36,7 @@ func Restart() error {
|
|||
if ncutils.IsWindows() {
|
||||
RestartWindowsDaemon()
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
pid, err := ncutils.ReadPID()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to find pid %w", err)
|
||||
|
|
@ -49,6 +49,7 @@ func Restart() error {
|
|||
return fmt.Errorf("SIGHUP failed -- %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// Start - starts system daemon
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ func SavePID() error {
|
|||
func ReadPID() (int, error) {
|
||||
if IsWindows() {
|
||||
return 0, &WindowsPIDError{}
|
||||
} else {
|
||||
}
|
||||
bytes, err := os.ReadFile(PIDFILE)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("could not read pid file %w", err)
|
||||
|
|
@ -43,5 +43,4 @@ func ReadPID() (int, error) {
|
|||
return 0, fmt.Errorf("pid file contents invalid %w", err)
|
||||
}
|
||||
return pid, nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue