NetBSD/share/sushi/system/sshdconf/script

27 lines
634 B
Bash
Executable File

#!/bin/sh
# $NetBSD: script,v 1.1 2001/08/02 05:41:19 garbled Exp $
if [ "$1" = "yes" ]; then
RESTART=yes
fi
OPT=`cat /usr/share/sushi/system/sshdconf/form | sed -e 's/.*script[1-9],\(.*\) *.*/\1/' \
| sed -e 's/,.*//' | grep -v '^#' | grep -v '^list:'`
echo -n "# Generated by sushi on " > /etc/sshd.conf
date >>/etc/sshd.conf
a=2
for i in $OPT
do
ANS=$(echo `eval echo \\$${a}`)
if [ ! -z "$ANS" ]; then
echo "$i $ANS" >> /etc/sshd.conf
fi
a=`expr $a + 1`
done
chmod 644 /etc/sshd.conf
chown root:wheel /etc/sshd.conf
echo "Successfully wrote a new sshd.conf file"
if [ ! -z "$RESTART" ]; then
/etc/rc.d/sshd reload
fi