mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Add hostname to teleporter backup file if called from cli
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
debc9a69c5
commit
7dc7cbb80e
1 changed files with 8 additions and 5 deletions
|
@ -238,18 +238,18 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423
|
||||||
# 168.192.in-addr.arpa to 192.168.0.0/16
|
# 168.192.in-addr.arpa to 192.168.0.0/16
|
||||||
# 192.in-addr.arpa to 192.0.0.0/8
|
# 192.in-addr.arpa to 192.0.0.0/8
|
||||||
if [[ "${CONDITIONAL_FORWARDING_REVERSE}" == *"in-addr.arpa" ]];then
|
if [[ "${CONDITIONAL_FORWARDING_REVERSE}" == *"in-addr.arpa" ]];then
|
||||||
arrRev=("${CONDITIONAL_FORWARDING_REVERSE//./ }")
|
arrRev=("${CONDITIONAL_FORWARDING_REVERSE//./ }")
|
||||||
case ${#arrRev[@]} in
|
case ${#arrRev[@]} in
|
||||||
6 ) REV_SERVER_CIDR="${arrRev[3]}.${arrRev[2]}.${arrRev[1]}.${arrRev[0]}/32";;
|
6 ) REV_SERVER_CIDR="${arrRev[3]}.${arrRev[2]}.${arrRev[1]}.${arrRev[0]}/32";;
|
||||||
5 ) REV_SERVER_CIDR="${arrRev[2]}.${arrRev[1]}.${arrRev[0]}.0/24";;
|
5 ) REV_SERVER_CIDR="${arrRev[2]}.${arrRev[1]}.${arrRev[0]}.0/24";;
|
||||||
4 ) REV_SERVER_CIDR="${arrRev[1]}.${arrRev[0]}.0.0/16";;
|
4 ) REV_SERVER_CIDR="${arrRev[1]}.${arrRev[0]}.0.0/16";;
|
||||||
3 ) REV_SERVER_CIDR="${arrRev[0]}.0.0.0/8";;
|
3 ) REV_SERVER_CIDR="${arrRev[0]}.0.0.0/8";;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
# Set REV_SERVER_CIDR to whatever value it was set to
|
# Set REV_SERVER_CIDR to whatever value it was set to
|
||||||
REV_SERVER_CIDR="${CONDITIONAL_FORWARDING_REVERSE}"
|
REV_SERVER_CIDR="${CONDITIONAL_FORWARDING_REVERSE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If REV_SERVER_CIDR is not converted by the above, then use the REV_SERVER_TARGET variable to derive it
|
# If REV_SERVER_CIDR is not converted by the above, then use the REV_SERVER_TARGET variable to derive it
|
||||||
if [ -z "${REV_SERVER_CIDR}" ]; then
|
if [ -z "${REV_SERVER_CIDR}" ]; then
|
||||||
# Convert existing input to /24 subnet (preserves legacy behavior)
|
# Convert existing input to /24 subnet (preserves legacy behavior)
|
||||||
|
@ -636,8 +636,11 @@ Interfaces:
|
||||||
|
|
||||||
Teleporter() {
|
Teleporter() {
|
||||||
local datetimestamp
|
local datetimestamp
|
||||||
|
local host
|
||||||
datetimestamp=$(date "+%Y-%m-%d_%H-%M-%S")
|
datetimestamp=$(date "+%Y-%m-%d_%H-%M-%S")
|
||||||
php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "pi-hole-teleporter_${datetimestamp}.tar.gz"
|
host=$(hostname)
|
||||||
|
host="${host//./_}"
|
||||||
|
php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "pi-hole-${host}-teleporter_${datetimestamp}.tar.gz"
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDomain()
|
checkDomain()
|
||||||
|
|
Loading…
Reference in a new issue