summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2018-09-27 17:15:36 +0000
committerreyk <reyk@openbsd.org>2018-09-27 17:15:36 +0000
commite0b12962eb5c0e3910cd66b12782e9eeecd22bfd (patch)
tree755d30e3b27b07bcd8938bb972e977bb57948d3e /etc/rc.d
parentAdd some extra curlies to make code more legible. (diff)
downloadwireguard-openbsd-e0b12962eb5c0e3910cd66b12782e9eeecd22bfd.tar.xz
wireguard-openbsd-e0b12962eb5c0e3910cd66b12782e9eeecd22bfd.zip
Add vmctl stop -a [-fw] option to stop or terminate all running VMs.
This is also be used to simplify the vmd rc stop script. OK mlarkin@ ccardenas@
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/vmd11
1 files changed, 2 insertions, 9 deletions
diff --git a/etc/rc.d/vmd b/etc/rc.d/vmd
index 5db928072bd..a81ddcc93f3 100644
--- a/etc/rc.d/vmd
+++ b/etc/rc.d/vmd
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: vmd,v 1.8 2018/07/11 13:19:47 reyk Exp $
+# $OpenBSD: vmd,v 1.9 2018/09/27 17:15:36 reyk Exp $
daemon="/usr/sbin/vmd"
@@ -11,15 +11,8 @@ rc_pre() {
${daemon} -n ${daemon_flags}
}
-list_running() {
- vmctl status | awk '$2 ~ "[0-9]" {print $8}'
-}
-
rc_stop() {
- for vm in $(list_running); do
- _rc_do vmctl stop "$vm" -w
- done
-
+ _rc_do vmctl stop -a -w
pkill -T "${daemon_rtable}" -xf "${pexp}"
}