~davewalker/ubuntu-on-ec2/cloud-utils

« back to all changes in this revision

Viewing changes to ssh-import-lp-id

  • Committer: Scott Moser
  • Date: 2010-07-21 13:39:30 UTC
  • Revision ID: smoser@ubuntu.com-20100721133930-g9b01i56f10bu109
do not require that ssh keys end in '='

while many/most base64 strings will end in '=', some wont.  See
https://launchpad.net/~zulcss/+sshkeys for example.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
        # Count lines
60
60
        lines=$(wc -l < "${1}")
61
61
        # Count valid keys
62
 
        keys=$(grep -c "^ssh-[dr]s[sa] [a-zA-Z0-9: .\/=+-]\+= " "$1")
 
62
        keys=$(grep -c "^ssh-[dr]s[sa] [a-zA-Z0-9: .\/=+-]\+ " "$1")
63
63
        # Validate counts match, and >0
64
64
        [ $lines -gt 0 ] && [ $keys -eq $lines ]
65
65
}