summaryrefslogtreecommitdiff
path: root/net/samba20/files/samba.sh
diff options
context:
space:
mode:
Diffstat (limited to 'net/samba20/files/samba.sh')
-rw-r--r--net/samba20/files/samba.sh61
1 files changed, 29 insertions, 32 deletions
diff --git a/net/samba20/files/samba.sh b/net/samba20/files/samba.sh
index 5fe93e2a90b..be58749b28d 100644
--- a/net/samba20/files/samba.sh
+++ b/net/samba20/files/samba.sh
@@ -1,52 +1,49 @@
#!/bin/sh
#
-# $NetBSD: samba.sh,v 1.2 2001/08/23 04:15:11 jlam Exp $
+# $NetBSD: samba.sh,v 1.3 2001/11/21 17:17:44 jlam Exp $
#
# PROVIDE: samba
-# REQUIRE: DAEMON
-#
-# nmbd may require DNS to resolve NetBIOS hostnames, and smbd may be acting as
-# a Backup Domain Controller and may need the network to be up, so simply
-# require DAEMON above.
-#
-# To use this script, copy to /etc/rc.d and set samba=YES in /etc/rc.conf.
-# You may also set nmbd_flags and smbd_flags to any additional options you
-# wish to pass to the Samba daemons.
+# KEYWORD: nostart
if [ -d /etc/rc.d -a -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
-arg="$1"
-rcvar="samba"
-required_files="@SAMBA_ETCDIR@/smb.conf"
-extra_commands="reload"
-command_args="-D" # _must_ start as daemon from rc.d;
- # add more flags through ${${name}_flags}
+# NOTE: run_rc_command sets $_arg
+#
+forward_commands()
+{
+ for file in $COMMAND_LIST; do
+ /etc/rc.d/$file $_arg
+ done
+}
-name="nmbd"
-command="@PREFIX@/sbin/${name}"
-reload_cmd=":" # avoid dumping debug output on SIGHUP
+reverse_commands()
+{
+ REVCOMMAND_LIST=
+ for file in $COMMAND_LIST; do
+ REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
+ done
+ for file in $REVCOMMAND_LIST; do
+ /etc/rc.d/$file $_arg
+ done
+}
-if [ ! -d /etc/rc.d ]
-then
- @ECHO@ -n ' ${name}'
- ${command} ${nmbd_flags} ${command_args}
-else
- load_rc_config $name
- run_rc_command "$arg"
-fi
+COMMAND_LIST="nmbd smbd"
-name="smbd"
-command="@PREFIX@/sbin/${name}"
-reload_cmd= # use default reload command for smbd
+name="samba"
+start_cmd="forward_commands"
+stop_cmd="reverse_commands"
+reload_cmd="forward_commands"
+status_cmd="forward_commands"
+extra_commands="reload status"
if [ ! -d /etc/rc.d ]
then
@ECHO@ -n ' ${name}'
- ${command} ${smbd_flags} ${command_args}
+ _arg="$1"
+ ${start_cmd}
else
- load_rc_config $name
run_rc_command "$1"
fi