# Placed in the Public Domain.
PORT=4242
+USER=`id -un`
+SUDO=
#SUDO=sudo
-if [ -x /usr/ucb/whoami ]; then
- USER=`/usr/ucb/whoami`
-elif whoami >/dev/null 2>&1; then
- USER=`whoami`
-else
- USER=`id -un`
-fi
-
OBJ=$1
if [ "x$OBJ" = "x" ]; then
echo '$OBJ not defined'
#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER
# helper
-echon()
-{
- if [ "x`echo -n`" = "x" ]; then
- echo -n "$@"
- elif [ "x`echo '\c'`" = "x" ]; then
- echo "$@\c"
- else
- fatal "Don't know how to echo without newline."
- fi
-}
-
-have_prog()
-{
- saved_IFS="$IFS"
- IFS=":"
- for i in $PATH
- do
- if [ -x $i/$1 ]; then
- IFS="$saved_IFS"
- return 0
- fi
- done
- IFS="$saved_IFS"
- return 1
-}
-
cleanup ()
{
if [ -f $PIDFILE ]; then
fatal ()
{
- echon "FATAL: "
+ echo -n "FATAL: "
fail "$@"
cleanup
exit $RESULT
PidFile $PIDFILE
AuthorizedKeysFile $OBJ/authorized_keys_%u
LogLevel QUIET
- StrictModes no
EOF
# server config for proxy connects
# known hosts file for client
(
- echon 'localhost-with-alias,127.0.0.1,::1 '
+ echo -n 'localhost-with-alias,127.0.0.1,::1 '
cat $OBJ/$t.pub
) >> $OBJ/known_hosts
# create a proxy version of the client config
(
cat $OBJ/ssh_config
- echo proxycommand ${SUDO} ${SSHD} -i -f $OBJ/sshd_proxy
+ echo proxycommand ${SSHD} -i -f $OBJ/sshd_proxy
) > $OBJ/ssh_proxy
# check proxy config
trace "wait for sshd"
i=0;
- while [ ! -f $PIDFILE -a $i -lt 10 ]; do
+ while [ ! -f $PIDFILE -a $i -lt 5 ]; do
i=`expr $i + 1`
sleep $i
done