#!/bin/sh
# $Id: sftp.control,v 1.2 2003/10/26 17:46:33 solar Exp $

. /etc/control.d/functions

CONFIG=/etc/ssh/sshd_config

new_subst on \
	'^Subsystem[[:space:]]+sftp[[:space:]]+/usr/libexec/sftp-server$' \
	's,^#\(Subsystem[[:space:]]\+sftp[[:space:]]\+/usr/libexec/sftp-server\),\1,'
new_subst off \
	'^#Subsystem[[:space:]]+sftp[[:space:]]+/usr/libexec/sftp-server$' \
	's,^\(Subsystem[[:space:]]\+sftp[[:space:]]\+/usr/libexec/sftp-server\),#\1,'

# Backwards compatibility
test "$*" = enabled && set - on
test "$*" = disabled && set - off

control_subst "$CONFIG" "$*" || exit 1

case "$*" in
on|off)
	/etc/rc.d/sshd reload
	;;
esac
