archdir=/mit/$(ATHENA_USER)/arch/
common=$(archdir)/common/
-scripts=bores-me card-access grep-owners ldapfinger list-members list-of-lists-updater lists-lint rt-set rt-resolve check-host update-officers make-zcrypt-key get-emails mail-merge
+scripts=bores-me card-access grep-owners ldapfinger list-members list-of-lists-updater lists-lint rt-set rt-resolve check-host update-officers make-zcrypt-key get-emails mail-merge sshroot
arches=i386_deb31 i386_deb40 i386_deb50 i386_rhel4
all : install
exec "$@"
}
-case $1 in
+command="$1"
+shift
+
+case "$command" in
init)
- shift;
- unset SSH_AUTH_SOCK SSH_AGENT_PID
- echo exec keychain --host "$hostopt-root" $keys
+ echo "Loading default keys (lifetime $lifetime)..."
+ with-keys ssh-add -t $lifetime "$@" $keys
;;
add)
+ echo "Loading keys (lifetime $lifetime):" "$@"
with-keys ssh-add -t $lifetime "$@"
;;
+ list)
+ with-keys ssh-add -l
+ ;;
destroy)
with-keys ssh-add -D
;;
shell)
- HOSTNAME="`hostname` (sshroot)" with-keys $SHELL
+ with-keys $SHELL
;;
ssh)
- shift
with-keys ssh -l root "$@"
;;
*)
- if [ $# = 0 ]; then
+ if [ -z "$command" ]; then
echo "Usage: $0 init" >&2
echo " $0 add" >&2
+ echo " $0 list" >&2
echo " $0 destroy" >&2
echo " $0 shell" >&2
echo " $0 ssh [args]" >&2
echo " $0 [cmd]" >&2
else
- with-keys "$@"
+ echo Executing: "$command" "$@"
+ with-keys "$command" "$@"
fi
;;
esac