7221a04eea
are taken from the manpage.
34 lines
861 B
Bash
Executable File
34 lines
861 B
Bash
Executable File
#!/bin/sh
|
|
# $NetBSD: script3,v 1.1 2001/08/02 05:41:19 garbled Exp $
|
|
|
|
NUM=`grep -c "^$1" /etc/sshd.conf`
|
|
|
|
if [ "$2" = "1" ]; then
|
|
VAR=`grep "^$1" /etc/sshd.conf | awk '{print $2}' | head -1`
|
|
if [ -z "$VAR" ]; then
|
|
VAR=`grep "^$1" /usr/share/sushi/system/sshdconf/defaults | awk '{print $2}' | head -1`
|
|
fi
|
|
fi
|
|
if [ "$2" = "2" ]; then
|
|
if [ $NUM -gt 1 ]; then
|
|
VAR=`grep "^$1" /etc/sshd.conf | awk '{print $2}' | head -2 | tail -1`
|
|
fi
|
|
if [ -z "$VAR" ]; then
|
|
VAR=`grep "^$1" /usr/share/sushi/system/sshdconf/defaults | awk '{print $2}' | head -2 | tail -1`
|
|
fi
|
|
fi
|
|
if [ "$2" = "3" ]; then
|
|
if [ $NUM -gt 2 ]; then
|
|
VAR=`grep "^$1" /etc/sshd.conf | awk '{print $2}' | tail -1`
|
|
fi
|
|
if [ -z "$VAR" ]; then
|
|
VAR=`grep "^$1" /usr/share/sushi/system/sshdconf/defaults | awk '{print $2}' | tail -1`
|
|
fi
|
|
fi
|
|
|
|
if [ -z "$VAR" ]; then
|
|
echo ""
|
|
else
|
|
echo "$VAR"
|
|
fi
|