Masato Taruishi
taru****@users*****
2004年 10月 28日 (木) 16:18:18 JST
=================================================================== RCS file: ultrapossum/sshman,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ultrapossum/sshman 2004/10/08 06:57:01 1.5 +++ ultrapossum/sshman 2004/10/28 07:18:18 1.6 @@ -74,9 +74,22 @@ fi } -# cmd <host> <cmd> +# cmd <host> <cmd> [<arg..>] cmd() { - getconfig | ssh -T -i $SSHKEYDIR/$2/id_rsa $1 $MODULEDIR/$2 + host=$1 + cmd=$2 + shift 2 + arg "$@" | ssh -T -i $SSHKEYDIR/$cmd/id_rsa $host $MODULEDIR/$cmd +} + +# arg [<arg..>] +arg() { + getconfig + echo -n "sshman_args=\"" + for a in "$@"; do + echo -n " $a" + done + echo "\"" } case "x$1" in @@ -93,10 +106,13 @@ ;; xcmd) if test "x$3" = "x"; then - echo "Usage: $0 cmd <host> <cmd>" 1>&2 + echo "Usage: $0 cmd <host> <cmd> [<arg..>]" 1>&2 exit 1 fi - cmd "$2" "$3" + host=$2 + cmd=$3 + shift 3 + cmd "$host" "$cmd" "$@" ;; x) echo "Usage: $0 keygen <cmd>|keyremove <cmd>|list|auth|unauth|cmd <host> <cmd>" 1>&2