Skip to content

Commit

Permalink
finish generate-file-from
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Jaeger (servi-1) committed Aug 2, 2012
1 parent 5dcec04 commit 00e3df0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ PS. the Makefile now uses absolute paths; this means, you can do:
somehost:/etc/ssh# ln -s /opt/chj/ssh-config-gen/Makefile

and then just run 'make' from /etc/ssh/.

There's also generate-file-from, which allows you to write your own
Makefile with an entry like:

data: data-in
/opt/chj/ssh-config-gen/generate-file-from data data-in

11 changes: 7 additions & 4 deletions generate-file-from
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

set -eu

w=`whami`
to="$1"
from="$2"

/opt/chj/ssh-config-gen/filter_file assign-in \
w="${WHAMI-`whami`}"

/opt/chj/ssh-config-gen/filter_file "$from" \
| cpp -Dnetwork_"$w"=1 \
| filter_whitespace > assign.new
| /opt/chj/bin/filter_whitespace > ."$to".new

mv assign.new assign
mv ."$to".new "$to"

0 comments on commit 00e3df0

Please sign in to comment.