]> git.madduck.net Git - etc/ssh.git/blob - .ssh/Makefile

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

special case the road warrior fishbowl in terms of Host
[etc/ssh.git] / .ssh / Makefile
1 all: known_hosts authorized_keys config
2         @chmod -R og= .
3 .PHONY: all
4
5 known_hosts: $(wildcard known_hosts.d/*)
6         touch $@
7         for f in $^; do \
8           echo "### from $$f:"; \
9           cat $$f; \
10           echo; \
11         done > $@
12
13 authorized_keys: $(wildcard authorized_keys.d/*)
14         touch $@
15         for f in $^; do \
16           echo "### from $$f:"; \
17           cat $$f; \
18           echo; \
19         done > $@
20
21 ifeq ($(strip $(wildcard config.local)),)
22 LOCAL_CONFIG=/dev/null
23 else
24 LOCAL_CONFIG=config.local
25 endif
26
27 SSH_VERSION = $(shell ssh -V 2>&1)
28 config: $(LOCAL_CONFIG) config.in
29         cat $^ > $@
30         case "$(SSH_VERSION)" in \
31           (OpenSSH_6.[0123]*) \
32             sed -ri -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
33                     $@ \
34             ;; \
35           (OpenSSH_5.[012345]*) \
36             sed -ri -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
37                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
38                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
39                     $@ \
40             ;; \
41           (OpenSSH_4.7*) \
42             sed -ri -e 's,^.+\bVisualHostKey\b.+$$,##UNSUPPORTED##&,' \
43                     -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
44                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
45                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
46                     $@ \
47             ;; \
48           (OpenSSH_4.3*) \
49             sed -ri -e 's,^.+\bExitOnForwardFailure\b.+$$,##UNSUPPORTED##&,' \
50                     -e 's,^.+\bMACs\b.+$$,##UNSUPPORTED##&,' \
51                     -e 's,^(.+ControlPath ~/.var/ssh/ssh_control_)%l_(.+),\1\2,' \
52                     -e 's,^.+\bVisualHostKey\b.+$$,##UNSUPPORTED##&,' \
53                     -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
54                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
55                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
56                     $@ \
57             ;; \
58           (3.9*) \
59             sed -ri -e 's,^.+\bExitOnForwardFailure\b.+$$,##UNSUPPORTED##&,' \
60                     -e 's,^.+\bMACs\b.+$$,##UNSUPPORTED##&,' \
61                     -e 's,^.+\bHashKnownHosts\b.+$$,##UNSUPPORTED##&,' \
62                     -e 's,^.+\bControl(Master|Path|Persist)\b.+$$,##UNSUPPORTED##&,' \
63                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
64                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
65                     $@ \
66             ;; \
67         esac; \
68         sed -i -re '/^Host fishbowl/,/^[[:space:]]*ProxyCommand/s/ProxyCommand.*/Host localhost/' $@