-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (32 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
HOSTNAME=$(shell hostname)
DEST=$(shell pwd)/$(HOSTNAME)
ID=$(shell whoami)
.PHONY: all bird sysctl.d wireguard roa net
all: bird sysctl.d wireguard roa net
bird:
mkdir -p $(DEST)/$@
sudo rsync --delete -av --exclude 'bird.conf.orig' --include 'roa.conf' --exclude 'roa*' /etc/$@/. $(DEST)/$@/.
sudo chown -R $(ID): $(DEST)/$@/.
roa:
mkdir -p $(DEST)/$@
sudo cp /usr/local/bin/dn42-roa-update.sh $(DEST)/$@/.
sudo cp /usr/local/bin/dn42-roa-update.sh $(DEST)/$@/.
sudo cp /etc/systemd/system/dn42-roa.* $(DEST)/$@/.
sudo chown -R $(ID): $(DEST)/$@/.
sysctl.d:
mkdir -p $(DEST)/$@
sudo rsync --delete -av --exclude='README.sysctl' --exclude '99-sysctl.conf' /etc/$@/. $(DEST)/$@/.
sudo chown -R $(ID): $(DEST)/$@/.
wireguard:
mkdir -p $(DEST)/$@
sudo rsync --delete -av --include='*.conf' --exclude='*' /etc/$@/. $(DEST)/$@/.
sudo chown -R $(ID): $(DEST)/$@/.
sed -i 's/PrivateKey =.*$$/PrivateKey = /g' $(DEST)/$@/*.conf
net:
mkdir -p $(DEST)/$@
mkdir -p $(DEST)/$@/$(HOSTNAME)
sudo rsync -av --exclude='50-cloud-init.yaml' /etc/netplan/. $(DEST)/$@/.
sudo cp /etc/systemd/resolved.conf $(DEST)/$@/
sudo chown -R $(ID): $(DEST)/$@/.
librenms:
scp librenms-dn42.nbsdn:/opt/librenms/html/plugins/Weathermap/configs/dn42-as4242420263.conf librenms-phpweathermap-dn42-as4242420263.conf