diff options
Diffstat (limited to 'net/ja-samba/files/samba.sh')
-rw-r--r-- | net/ja-samba/files/samba.sh | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/net/ja-samba/files/samba.sh b/net/ja-samba/files/samba.sh new file mode 100644 index 00000000000..2f597a10fca --- /dev/null +++ b/net/ja-samba/files/samba.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# +# $NetBSD: samba.sh,v 1.1.1.1 2002/06/25 15:31:34 taca Exp $ +# +# KEYWORD: nostart + +if [ -f /etc/rc.subr ] +then + . /etc/rc.subr +fi + +rcd_dir=`@DIRNAME@ $0` + +# NOTE: run_rc_command sets $rc_arg +# +forward_commands() +{ + # Backward compat with NetBSD <1.6: + [ -z "$rc_arg" ] && rc_arg=$_arg + + for file in $COMMAND_LIST; do + $rcd_dir/$file $rc_arg + done +} + +reverse_commands() +{ + # Backward compat with NetBSD <1.6: + [ -z "$rc_arg" ] && rc_arg=$_arg + + REVCOMMAND_LIST= + for file in $COMMAND_LIST; do + REVCOMMAND_LIST="$file $REVCOMMAND_LIST" + done + for file in $REVCOMMAND_LIST; do + $rcd_dir/$file $rc_arg + done +} + +COMMAND_LIST="nmbd smbd" + +name="samba" +start_cmd="forward_commands" +stop_cmd="reverse_commands" +reload_cmd="forward_commands" +status_cmd="forward_commands" +extra_commands="reload status" + +if [ -f /etc/rc.subr ] +then + run_rc_command "$1" +else + @ECHO@ -n ' ${name}' + _arg="$1" + ${start_cmd} +fi |