diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..29b9577 --- /dev/null +++ b/Makefile | |||
@@ -0,0 +1,27 @@ | |||
1 | control: control.sh depends.control .git/refs/heads/master | ||
2 | ./control.sh depends.control > $@ | ||
3 | |||
4 | DD_USER = dyndns | ||
5 | DD_GROUP = dyndns | ||
6 | |||
7 | install-dyndns-server: | ||
8 | ifneq ($(shell id -u),0) | ||
9 | $(SUDO_MAKE) $@ | ||
10 | else | ||
11 | : apt install pdns | ||
12 | : adduser $(DD_USER) | ||
13 | chown root:$(DD_GROUP) /etc/powerdns | ||
14 | chown pdns:$(DD_GROUP) /etc/powerdns/powerdns.sqlite3 | ||
15 | chmod g+rwx /etc/powerdns | ||
16 | chmod g+rw /etc/powerdns/powerdns.sqlite3 | ||
17 | $(MAKE) ~$(DD_USER)/.ssh/authorized_keys | ||
18 | install src/samizdat-ssh-command /usr/local/bin/ | ||
19 | install src/dyndns-command.sh ~$(DD_USER)/samizdat-default-command | ||
20 | endif | ||
21 | |||
22 | define dyndns_authorized_keys_contents | ||
23 | command="/usr/local/bin/samizdat-ssh-command /etc/powerdns/dyndns-command.sh",no-port-forwarding * Samizdat - YES WE CAN | ||
24 | endef | ||
25 | |||
26 | ~$(DD_USER)/.ssh/authorized_keys: | ||
27 | : writing file $@ $(file >$@,$(dyndns_authorized_keys_contents)) | ||