#!/bin/sh # # $FreeBSD$ # # PROVIDE: wsdd # REQUIRE: DAEMON samba_server # BEFORE: login # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable wsdd # # wsdd_enable (bool): Set to NO by default. # Set it to YES to enable wsdd. # wsdd_smb_conf_file (path): Set to %%PREFIX%%/etc/smb4.conf # by default. # wsdd_flags (string): Additional flags . /etc/rc.subr name=wsdd rcvar=wsdd_enable load_rc_config $name : ${wsdd_enable:="NO"} : ${wsdd_smb_conf_file:="%%PREFIX%%/etc/smb4.conf"} if [ -r $wsdd_smb_conf_file ]; then wsdd_group="$(grep -i '^[[:space:]]*workgroup[[:space:]]*=' $wsdd_smb_conf_file | cut -f2 -d= | tr -d '[:blank:]')" wsdd_opts="-w ${wsdd_group}" fi command="/usr/sbin/daemon" command_args="-u daemon -S /usr/local/bin/wsdd $wsdd_opts" required_files=$wsdd_smb_conf_file run_rc_command "$1"