diff options
author | June McEnroe <june@causal.agency> | 2019-08-28 23:59:48 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-08-28 23:59:48 -0400 |
commit | 8940bb17b1012adef9f86a6a15d683ec94f224e0 (patch) | |
tree | c721b7ac68cd8caaf833c1b2f06499633cbfe780 /etc | |
parent | Add Birds Contending (diff) | |
download | src-8940bb17b1012adef9f86a6a15d683ec94f224e0.tar.gz src-8940bb17b1012adef9f86a6a15d683ec94f224e0.zip |
Add samba_mdns rc script
Diffstat (limited to '')
-rw-r--r-- | etc/samba_mdns | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/etc/samba_mdns b/etc/samba_mdns new file mode 100644 index 00000000..66b13af7 --- /dev/null +++ b/etc/samba_mdns @@ -0,0 +1,26 @@ +#!/bin/sh + +# PROVIDE: samba_mdns +# REQUIRE: samba_server mdnsd +# KEYWORD: shutdown + +. /etc/rc.subr + +name="samba_mdns" +rcvar="samba_mdns_enable" + +load_rc_config $name + +: ${samba_mdns_enable:="NO"} +: ${samba_mdns_name:="${hostname}"} +: ${samba_mdns_port:="445"} +: ${samba_mdns_text:=""} + +procname="/usr/local/sbin/mdnsctl" +command="/usr/sbin/daemon" +pidfile="/var/run/${name}.pid" + +publish_args="${samba_mdns_name} smb tcp ${samba_mdns_port} '${samba_mdns_text}'" +command_args="-T mdnsctl -p ${pidfile} -- ${procname} publish ${publish_args}" + +run_rc_command "$1" |