aboutsummaryrefslogtreecommitdiffstats
path: root/ssh/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
committerMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
commit0f1df0db903ba576fd17b08197d3066af7a61e5f (patch)
treea59c04307b1382257afa3c3512ec3abadf7e0e47 /ssh/Makefile
parentUse losetup -d instead of --detach and add clean up (diff)
downloaddotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.gz
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.bz2
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.xz
A lot of changes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'ssh/Makefile')
-rw-r--r--ssh/Makefile54
1 files changed, 54 insertions, 0 deletions
diff --git a/ssh/Makefile b/ssh/Makefile
new file mode 100644
index 0000000..b16f051
--- /dev/null
+++ b/ssh/Makefile
@@ -0,0 +1,54 @@
+.POSIX:
+
+install:
+ -rm -f -- .ssh-config
+ test ! -e .ssh-config && test ! -L .ssh-config
+ printf '# %s\n' 'THIS FILE IS GENERATED from ~/.dotfiles/ssh/Makefile' \
+ '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' > .ssh-config
+ printf '\n\n' >> .ssh-config
+ if test -f config; then \
+ cat config >> .ssh-config; \
+ fi
+ set config.d/* && if test -f "$$1"; then \
+ ../cat-nonbackups -- "$$@" >> .ssh-config; \
+ fi
+ if test -f ../.secrets/ssh/config; then \
+ cat ../.secrets/ssh/config >> .ssh-config; \
+ fi
+ set ../.secrets/ssh/config.d/* && if test -f "$$1"; then \
+ ../cat-nonbackups "$$@" >> .ssh-config; \
+ fi
+ if test -f ../.work/ssh/config; then \
+ cat ../.work/ssh/config >> .ssh-config; \
+ fi
+ set ../.work/ssh/config.d/* && if test -f "$$1"; then \
+ ../cat-nonbackups "$$@" >> .ssh-config; \
+ fi
+ mkdir -p -- ~/.ssh
+ test ! -e ~/.ssh/config || test -L ~/.ssh/config
+ test ! -e ~/.ssh/config || test -f ~/.ssh/config
+ ln -sf -- ~/.dotfiles/ssh/.ssh-config ~/.ssh/config
+ set ~/.dotfiles/.secrets/ssh/keys/* && if test -f "$$1"; then \
+ ln -sf -- "$$@" ~/.ssh/; \
+ fi
+ set ~/.dotfiles/.work/ssh/keys/* && if test -f "$$1"; then \
+ ln -sf -- "$$@" ~/.ssh/; \
+ fi
+ mkdir -p -- ~/.config/bash/aliases.d
+ test ! -e ~/.config/bash/aliases.d/openssh || test -L ~/.config/bash/aliases.d/openssh
+ ln -sf -- ~/.dotfiles/openssh/bash-aliases ~/.config/bash/aliases.d/openssh
+
+uninstall:
+ +! ../check-installed ssh
+ +! ../check-installed openssh
+ -unlink -- ~/.ssh/config
+ -unlink -- ~/.ssh/known_hosts
+ -unlink -- ~/.ssh/known_hosts.old
+ -cd ../.work/ssh/keys/ && set * && if test -f "$$1"; then \
+ cd ~/.ssh/ && \
+ rm -f -- "$$@"; \
+ fi
+ -rmdir -- ~/.ssh
+ -rm -f -- .ssh-config
+ -unlink -- ~/.config/bash/aliases.d/openssh
+ -rmdir -- ~/.config/bash/aliases.d