diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-31 11:53:31 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-31 11:54:55 +1200 |
commit | 17f6305e253cc36acec5384c55d8369405645a03 (patch) | |
tree | 12aff25cfd17fa3deabbab1b8b42fb46a090f96c /bin/slsf | |
parent | Remove poetry games tinkering scripts (diff) | |
download | dotfiles-17f6305e253cc36acec5384c55d8369405645a03.tar.gz dotfiles-17f6305e253cc36acec5384c55d8369405645a03.zip |
Split out sls(1) into shell and awk
Diffstat (limited to 'bin/slsf')
-rwxr-xr-x | bin/slsf | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/slsf b/bin/slsf new file mode 100755 index 00000000..72af8691 --- /dev/null +++ b/bin/slsf @@ -0,0 +1,9 @@ +#!/usr/bin/awk -f + +# Manage the processing flag (starts set in each file) +FNR == 1 || /### sls/ { sls = 1 } +/### nosls/ { sls = 0 } + +# If processing flag set, directive is "Host", and hostname has no wildcards, +# then print it +sls && $1 == "Host" && $2 !~ /\*/ { print $2 } |