Merge pull request #4582 from lschloetterer/patch-1
add parameter to set filename for teleporter
This commit is contained in:
commit
2bd670a3dd
|
@ -45,7 +45,8 @@ Options:
|
|||
-h, --help Show this help dialog
|
||||
-i, interface Specify dnsmasq's interface listening behavior
|
||||
-l, privacylevel Set privacy level (0 = lowest, 3 = highest)
|
||||
-t, teleporter Backup configuration as an archive"
|
||||
-t, teleporter Backup configuration as an archive
|
||||
-t, teleporter myname.tar.gz Backup configuration to archive with name myname.tar.gz as specified"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
@ -640,12 +641,17 @@ Interfaces:
|
|||
}
|
||||
|
||||
Teleporter() {
|
||||
local filename
|
||||
filename="${args[2]}"
|
||||
if [[ -z "${filename}" ]]; then
|
||||
local datetimestamp
|
||||
local host
|
||||
datetimestamp=$(date "+%Y-%m-%d_%H-%M-%S")
|
||||
host=$(hostname)
|
||||
host="${host//./_}"
|
||||
php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "pi-hole-${host:-noname}-teleporter_${datetimestamp}.tar.gz"
|
||||
filename="pi-hole-${host:-noname}-teleporter_${datetimestamp}.tar.gz"
|
||||
fi
|
||||
php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "${filename}"
|
||||
}
|
||||
|
||||
checkDomain()
|
||||
|
|
Loading…
Reference in New Issue