aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2021-07-13 11:43:18 +0300
committerOmar Polo <op@omarpolo.com>2021-07-13 11:09:13 +0200
commitcaf4e5fb22647a2c56c60c4037471c8b6d8c53d8 (patch)
tree46a79ca5e3741291416f1f13db127f6592bba04d /contrib
parentdbbfd0fb9fc9eb6541d54470691033aaf941f500 (diff)
add an example rc(8) script for openbsd
copy it to `/etc/rc.d`, write your config in `/etc/gmid.conf` and launch using `rcctl enable gmid && rcctl start gmid`.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/README3
-rw-r--r--contrib/gmid14
2 files changed, 17 insertions, 0 deletions
diff --git a/contrib/README b/contrib/README
index b2d39b0..d85fbb5 100644
--- a/contrib/README
+++ b/contrib/README
@@ -14,3 +14,6 @@ vim
Syntax highlighting of gmid configuration for vim, to be
placed into ~/.vim/ or /usr/share/vim/vimfiles.
+gmid
+
+ Sample rc(8) script for gmid for OpenBSD.
diff --git a/contrib/gmid b/contrib/gmid
new file mode 100644
index 0000000..67e5bc4
--- /dev/null
+++ b/contrib/gmid
@@ -0,0 +1,14 @@
+#!/bin/ksh
+#
+
+daemon="/usr/local/bin/gmid"
+daemon_flags="-c /etc/gmid.conf"
+
+. /etc/rc.d/rc.subr
+
+rc_pre() {
+ # use rcexec here since daemon_flags may contain arguments with spaces
+ ${rcexec} "${daemon} -n ${daemon_flags}"
+}
+
+rc_cmd $1