Skip to content

Commit d29c250

Browse files
authored
Merge pull request skonfig#162 from riiengineering/fix/type/__start_on_boot/openbsd-speedup
__start_on_boot: Speed up state explorer on OpenBSD
2 parents f169e8c + dca1822 commit d29c250

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

  • type/__start_on_boot/explorer

type/__start_on_boot/explorer/state

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,17 @@ else
155155
esac
156156
;;
157157
(openbsd)
158-
state='absent'
159158
# OpenBSD 5.7 and higher
160-
rcctl ls on | grep "^${name}$" && state='present'
159+
if rcctl get "${name}" status >/dev/null
160+
then
161+
state='present'
162+
else
163+
state='absent'
164+
fi
161165
;;
162166
163167
(*)
164-
printf 'Unsupported os: %s\n' "${os}" >&2
168+
printf 'Unsupported OS: %s\n' "${os}" >&2
165169
exit 1
166170
;;
167171
esac

0 commit comments

Comments
 (0)