Masato Taruishi
taru****@users*****
2004年 9月 29日 (水) 21:55:38 JST
=================================================================== RCS file: ultrapossum/modules.in,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- ultrapossum/modules.in 2004/09/15 12:17:50 1.45 +++ ultrapossum/modules.in 2004/09/29 12:55:38 1.46 @@ -56,6 +56,7 @@ APPSCONFDIR=${APPSCONFDIR:-$SYSCONFDIR/apps} TEMPLATEDIR=${TEMPLATEDIR:-$SYSCONFDIR/in.d} MODULECONFDIR=${MODULECONFDIR:-$SYSCONFDIR/module.d} +SSHKEYDIR=${SSHKEYDIR:-$SYSCONFDIR/ssh} CONFSTATUS=${CONFSTATUS:-$CONFDIR/status} ULTRAPOSSUMCF=${ULTRAPOSSUMCF:-$SYSCONFDIR/ultrapossum.cf} =================================================================== RCS file: ultrapossum/sshman,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ultrapossum/sshman 2004/09/27 16:27:45 1.1 +++ ultrapossum/sshman 2004/09/29 12:55:38 1.2 @@ -19,7 +19,19 @@ fi } +#keyremove <cmd> +keyremove() { + if ! test -f "$SSHKEYDIR/$1/id_rsa"; then + echo "No such key: $1" 1>&2 + exit 1 + fi + /bin/rm -f "$SSHKEYDIR/$1/id_rsa" "$SSHKEYDIR/$1/id_rsa.pub" + /bin/rmdir "$SSHKEYDIR/$1" 2> /dev/null || true + /bin/rmdir "$SSHKEYDIR/`dirname $1`" 2> /dev/null || true +} + list() { + install -m 750 -d $SSHKEYDIR ( cd $SSHKEYDIR find -name id_rsa | while read key do @@ -53,22 +65,16 @@ } case "x$1" in - xkeygen) - install -m 750 -d $SSHKEYDIR + xkeygen|xkeyremove) if test "x$2" = "x"; then - echo "Usage: $0 keygen <cmd>" 1>&2 + echo "Usage: $0 $1 <cmd>" 1>&2 exit 1 fi - keygen "$2" - ;; - xlist) - list - ;; - xauth) - auth + if test "x$1" = "xkeygen"; then install -m 750 -d $SSHKEYDIR; fi + "$1" "$2" ;; - xunauth) - unauth + xlist|xauth|xunauth) + $1 ;; xcmd) if test "x$3" = "x"; then @@ -78,7 +84,7 @@ cmd "$2" "$3" ;; x) - echo "Usage: $0 keygen <cmd>|list|auth|unauth|cmd <host> <cmd>" 1>&2 + echo "Usage: $0 keygen <cmd>|keyremove <cmd>|list|auth|unauth|cmd <host> <cmd>" 1>&2 ;; x*) echo "Unknown argument: $1" 1>&2