File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -821,14 +821,26 @@ ssh-for-all *ARGS:
821821ssh-for-each HOSTNAMES * ARGS :
822822 colmena exec --verbose --parallel 0 --on {{ HOSTNAMES}} {{ ARGS}}
823823
824+ # List machine ips based on regex pattern
825+ ssh-list-ids PATTERN :
826+ #!/ usr/ bin/ env nu
827+ scj dump / dev/ stdout -c .ssh_config
828+ | from json
829+ | default " " Host
830+ | default " " HostName
831+ | where not ($it.Host =~ " .ipv(4|6)$" )
832+ | where Host =~ " {{ PATTERN}} "
833+ | get HostName
834+ | str join " "
835+
824836# List machine ips based on regex pattern
825837ssh-list-ips PATTERN :
826838 #!/ usr/ bin/ env nu
827839 scj dump / dev/ stdout -c .ssh_config
828840 | from json
829841 | default " " Host
830842 | default " " HostName
831- | where not ($it.Host | str ends-with " .ipv6 " )
843+ | where not ($it.Host =~ " .ipv(4|6)$ " )
832844 | where Host =~ " {{ PATTERN}} "
833845 | get HostName
834846 | str join " "
@@ -840,7 +852,7 @@ ssh-list-names PATTERN:
840852 | from json
841853 | default " " Host
842854 | default " " HostName
843- | where not ($it.Host | str ends-with " .ipv6 " )
855+ | where not ($it.Host =~ " .ipv(4|6)$ " )
844856 | where Host =~ " {{ PATTERN}} "
845857 | get Host
846858 | str join " "
You can’t perform that action at this time.
0 commit comments