]> 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:

send wol every second for lotus
[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_7.[12]*) \
32                     sed -ri -e 's,ProxyJump ([-.[:alnum:]]+),ProxyCommand ssh \1 nc -q0 %h %p,' $@ \
33             ;; \
34           (OpenSSH_6.*) \
35             sed -ri -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
36                     -e 's,^.+\bIgnoreUnknown\b.+$$,##UNSUPPORTED##&,' \
37                     -e 's,^.+\bUpdateHostKeys\b.+$$,##UNSUPPORTED##&,' \
38                     -e 's,^Match host ,Host ,' \
39                     $@; \
40                     sed -ri -e 's,ProxyJump ([-.[:alnum:]]+),ProxyCommand ssh \1 nc -q0 %h %p,' $@ \
41             ;; \
42           (OpenSSH_5.*) \
43             sed -ri -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
44                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
45                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
46                     $@ \
47             ;; \
48           (OpenSSH_4.7*) \
49             sed -ri -e 's,^.+\bVisualHostKey\b.+$$,##UNSUPPORTED##&,' \
50                     -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
51                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
52                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
53                     $@ \
54             ;; \
55           (OpenSSH_4.3*) \
56             sed -ri -e 's,^.+\bExitOnForwardFailure\b.+$$,##UNSUPPORTED##&,' \
57                     -e 's,^.+\bMACs\b.+$$,##UNSUPPORTED##&,' \
58                     -e 's,^(.+ControlPath ~/.var/ssh/ssh_control_)%l_(.+),\1\2,' \
59                     -e 's,^.+\bVisualHostKey\b.+$$,##UNSUPPORTED##&,' \
60                     -e 's,^.+\bControlPersist\b.+$$,##UNSUPPORTED##&,' \
61                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
62                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
63                     $@ \
64             ;; \
65           (3.9*) \
66             sed -ri -e 's,^.+\bExitOnForwardFailure\b.+$$,##UNSUPPORTED##&,' \
67                     -e 's,^.+\bMACs\b.+$$,##UNSUPPORTED##&,' \
68                     -e 's,^.+\bHashKnownHosts\b.+$$,##UNSUPPORTED##&,' \
69                     -e 's,^.+\bControl(Master|Path|Persist)\b.+$$,##UNSUPPORTED##&,' \
70                     -e 's,^.+\bIPQoS\b.+$$,##UNSUPPORTED##&,' \
71                     -e 's,^.+\bCanonical.+$$,##UNSUPPORTED##&,' \
72                     $@ \
73             ;; \
74         esac; \
75         case "$$HOSTNAME" in \
76           (fishbowl) \
77             sed -i -re '/^Host fishbowl/,/^[[:space:]]*ProxyCommand/s/ProxyCommand.*/Host localhost/' $@; \
78         esac