Add "quick" host check command
[dowkd.git] / gen / gen-ssh.sh
blobe60b2fb5aa7ca5944ac2e9b41f088dc78a51f69d
1 #!/bin/bash
3 set -e
5 type=$1
6 case "$type" in
7 rsa|rsa1|dsa)
8 ;;
9 ?*)
10 echo "key type argument invalid"
11 exit 1
14 echo "key type argument missing"
15 exit 1
17 esac
19 bits=$2
20 if test -z "$bits" ; then
21 echo "bits argument missing"
22 exit 1
25 arch=$(dpkg-architecture -qDEB_HOST_ARCH)
26 dso=./setpid-$arch.so
28 prefix=keys/ssh/$arch/$type/$bits
29 rm -rf $prefix
30 mkdir -p $prefix
32 for x in {1..32767} ; do
33 echo "*** PID $x"
34 file=$prefix/$x
35 LD_PRELOAD=$dso SETPID=$x ssh-keygen -t $type -b $bits -P "" -f $file
36 done