Merge pull request #1430 from gravitl/release_v0.14.6

Release v0.14.6
This commit is contained in:
Matthew R Kasun 2022-07-27 17:57:35 -04:00 committed by GitHub
commit c861f0f8b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@ func (*WindowsPIDError) Error() string {
// SavePID - saves the pid of running program to disk // SavePID - saves the pid of running program to disk
func SavePID() error { func SavePID() error {
if IsWindows() { if IsWindows() {
return &WindowsPIDError{} return nil
} }
pid := os.Getpid() pid := os.Getpid()
if err := os.WriteFile(PIDFILE, []byte(fmt.Sprintf("%d", pid)), 0644); err != nil { if err := os.WriteFile(PIDFILE, []byte(fmt.Sprintf("%d", pid)), 0644); err != nil {
@ -32,7 +32,7 @@ func SavePID() error {
// ReadPID - reads a previously saved pid from disk // ReadPID - reads a previously saved pid from disk
func ReadPID() (int, error) { func ReadPID() (int, error) {
if IsWindows() { if IsWindows() {
return 0, &WindowsPIDError{} return 0, nil
} }
bytes, err := os.ReadFile(PIDFILE) bytes, err := os.ReadFile(PIDFILE)
if err != nil { if err != nil {

View file

@ -151,7 +151,7 @@ func deleteInterface(iface string, realIface string) error {
os.Remove("/var/run/wireguard/" + iface + ".name") os.Remove("/var/run/wireguard/" + iface + ".name")
} }
out, err = ncutils.RunCmd("ifconfig "+realIface+" down", false) out, err = ncutils.RunCmd("ifconfig "+realIface+" down", false)
if strings.Contains(err.Error(), "does not exist") { if err != nil && strings.Contains(err.Error(), "does not exist") {
err = nil err = nil
} else if err != nil && out != "" { } else if err != nil && out != "" {
err = errors.New(out) err = errors.New(out)