added contrib files

This commit is contained in:
Bart Sjerps
2026-06-06 20:00:50 +02:00
parent d805a5d27b
commit f77387ad1b
5 changed files with 104 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
}
vrrp_instance VI_1 {
state BACKUP
interface enp6s18
virtual_router_id 51
priority 50
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.10.1
}
}
+35
View File
@@ -0,0 +1,35 @@
! Configuration File for keepalived
! Firewall:
! firewall-cmd --add-rich-rule='rule protocol value="vrrp" accept' --permanent
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
}
vrrp_script chk_dns {
script "/usr/bin/nc -z -u 127.0.0.1 53"
interval 5
weight -60
}
vrrp_instance VI_1 {
state MASTER
interface enp6s18
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.10.1
}
track_script {
chk_dns
}
}
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
API_KEY=
URL=https://phantom1.lan:53443
#while IFS=, read -r domain ipaddr; do
# echo -n $ipaddr
# curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/zones/records/add?domain=$domain&type=A&ipAddress=$ipaddr&ptr=true"
# echo
#done < ~/bin/dns_hosts.csv
while IFS=, read -r domain cname; do
echo -n $domain
curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/zones/records/add?domain=$domain&type=CNAME&cname=$cname"
echo
done < ~/bin/dns_alias.csv
# "https://phantom1.lan:53443/api/zones/records/add?domain=api.phantom1.lan&type=CNAME&cname=backend.phantom1.lan&ttl=300&overwrite=true" | jq
# curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/zones/records/add?domain=$domain&type=A&ipAddress=$ipaddr&ptr=true"
echo
# &ttl=300&overwrite=true"
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
API_KEY=
URL1=https://phantom1.lan:53443
URL2=https://phantom2.lan:53443
curl --insecure --header "Authorization: Bearer $API_KEY" "$URL1/api/settings/backup?scopes=true&stats=true&zones=true&allowedZones=true&blockedZones=true&dnsSettings=true&logSettings=true&authConfig=true" -o technitium_1_backup.zip
curl --insecure --header "Authorization: Bearer $API_KEY" "$URL2/api/settings/backup?scopes=true&stats=true&zones=true&allowedZones=true&blockedZones=true&dnsSettings=true&logSettings=true&authConfig=true" -o technitium_2_backup.zip
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
API_KEY=
URL=https://phantom1.lan:53443
awk '{print $2,$6,$8}' dhcp.static | tr -d \; | grep '192.168.2\.' | while read -r domain mac ipaddr; do
echo -n "$domain|$mac|$ipaddr"
curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/dhcp/scopes/addReservedLease?name=dhcp2&hardwareAddress=$mac&ipAddress=$ipaddr&hostName=$domain"
echo
done