Merge branch 'issue/369' of https://github.com/asteven/cdist
commit
4a0380ab65
@ -1,32 +0,0 @@ |
||||
#!/bin/sh |
||||
# |
||||
# 2014 Steven Armstrong (steven-cdist at armstrong.cc) |
||||
# |
||||
# This file is part of cdist. |
||||
# |
||||
# cdist is free software: you can redistribute it and/or modify |
||||
# it under the terms of the GNU General Public License as published by |
||||
# the Free Software Foundation, either version 3 of the License, or |
||||
# (at your option) any later version. |
||||
# |
||||
# cdist is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU General Public License |
||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>. |
||||
# |
||||
|
||||
# Find and sort any entries in the authorized_keys file that we care about |
||||
|
||||
file="$($__type_explorer/file)" |
||||
|
||||
( |
||||
while read key; do |
||||
# extract the keytype and base64 encoded key ignoring any options and comment |
||||
type_and_key="$(echo "$key" | tr ' ' '\n' | awk '/^(ssh|ecdsa)-[^ ]+/ { printf $1" "; getline; printf $1 }')" |
||||
# emit any entries that match the type and key |
||||
grep ".*$type_and_key[ \n]" "$file" |
||||
done < "$__object/parameter/key" |
||||
) | sort |
Loading…
Reference in new issue