From 58970695b48e7d2ef382ecff57a6af1848a12ef5 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Sat, 15 May 2021 20:04:46 -0700 Subject: [PATCH] add masked check to isEnabled boolean --- systemctl.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/systemctl.go b/systemctl.go index 6b5e593..eaa8316 100644 --- a/systemctl.go +++ b/systemctl.go @@ -51,7 +51,10 @@ func IsEnabled(ctx context.Context, unit string, opts Options) (bool, error) { return true, nil } else if matched, _ := regexp.MatchString(`disabled`, stdout); matched { return false, nil + } else if matched, _ := regexp.MatchString(`masked`, stdout); matched { + return false, nil } + return false, err }