summaryrefslogtreecommitdiff
path: root/EndoForge/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'EndoForge/Makefile')
-rw-r--r--EndoForge/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/EndoForge/Makefile b/EndoForge/Makefile
index 3846ebd..b6bba95 100644
--- a/EndoForge/Makefile
+++ b/EndoForge/Makefile
@@ -1,8 +1,11 @@
1ENDOFORGE_BACKUPS = y 1ENDOFORGE_BACKUPS = y
2ifneq (,$(ENDOFORGE_BACKUPS)) 2ifneq (,$(ENDOFORGE_BACKUPS))
3INSTALL := install -b --suffix=~$(shell date -Ins | tr -d :) 3SUFFIX := ~$(shell date -Ins | tr -d :)
4INSTALL := install -b --suffix=$(SUFFIX)
5MV := mv -b --suffix=$(SUFFIX)
4else 6else
5INSTALL = install 7INSTALL = install
8MV = mv
6endif 9endif
7 10
8ifeq ($(shell id -u),0) 11ifeq ($(shell id -u),0)
@@ -32,12 +35,21 @@ SRC = src
32SOURCE_NAMES = AnonymousAccessCommand anonymous-access.conf AuthorizedKeysCommand sshd_config 35SOURCE_NAMES = AnonymousAccessCommand anonymous-access.conf AuthorizedKeysCommand sshd_config
33SOURCES = $(addprefix $(SRC), $(SOURCE_NAMES)) 36SOURCES = $(addprefix $(SRC), $(SOURCE_NAMES))
34 37
38KEYTYPE = ed25519
39define EDIT_SSHD
40sed \
41 -e 's?ForceCommand=$$?&$(HOME)/.ssh/AnonymousAccessCommand?' \
42 -e 's?AuthorizedKeysCommandUser=$$?&$(USER)?' \
43 -e 's?HostKey=$$?&$(HOME)/.ssh/id_$(KEYTYPE)?' \
44 -e 's?PidFile=$$?&$(HOME)/.ssh/sshd.pid?'
45endef
46
35install: install-user install-root 47install: install-user install-root
36 48
37install-user: 49install-user:
38 $(INSTALL) -d ~/.ssh 50 $(INSTALL) -d ~/.ssh
39 $(INSTALL) -t ~/.ssh $(SRC)/AnonymousAccessCommand 51 $(INSTALL) -t ~/.ssh $(SRC)/AnonymousAccessCommand
40 $(INSTALL) -m0600 -t ~/.ssh $(SRC)/sshd_config 52 $(EDIT_SSHD) < $(SRC)/sshd_config > ~/.ssh/sshd_config.tmp && $(MV) ~/.ssh/sshd_config.tmp ~/.ssh/sshd_config
41 53
42install-root: 54install-root:
43 $(ROOT_INSTALL) -d "$(SSH_CONFIG_DIR)" "$(SSHD_CONFIG_DIR)" "$(SSH_LIB_DIR)" || true 55 $(ROOT_INSTALL) -d "$(SSH_CONFIG_DIR)" "$(SSHD_CONFIG_DIR)" "$(SSH_LIB_DIR)" || true