update
This commit is contained in:
parent
cde17b7dc9
commit
ea76cc9ef2
7 changed files with 208 additions and 173 deletions
16
hosts.sh
Normal file
16
hosts.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
hosts() {
|
||||
if [ ! -r "$HOME/.ssh/config.d/hosts.conf" ]; then
|
||||
printf '%s\n' 'SSH host configuration is unavailable.' >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
awk '
|
||||
tolower($1) == "host" {
|
||||
for (field = 2; field <= NF; field++) {
|
||||
if ($field !~ /[*?!]/) print $field
|
||||
}
|
||||
}
|
||||
' "$HOME/.ssh/config.d/hosts.conf"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue