diff options
author | Adam Warner <me@adamwarner.co.uk> | 2022-02-04 23:44:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 23:44:49 +0300 |
commit | 2bd670a3ddf123697ce6d423c8fd876e505715b8 (patch) | |
tree | e214570668e173f7d0e97ab3a7be33d5722e7fe4 /advanced/Scripts/webpage.sh | |
parent | f342b2c9f6a69572e3f5d61904527c93366e7f7c (diff) | |
parent | 2a0bb5b9ee12d33f35f39c035ef931f48d6370cd (diff) |
Merge pull request #4582 from lschloetterer/patch-1
add parameter to set filename for teleporter
Diffstat (limited to 'advanced/Scripts/webpage.sh')
-rwxr-xr-x | advanced/Scripts/webpage.sh | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index 0b9fb62b..23b4f402 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -37,15 +37,16 @@ Example: pihole -a -p password Set options for the Admin Console Options: - -p, password Set Admin Console password - -c, celsius Set Celsius as preferred temperature unit - -f, fahrenheit Set Fahrenheit as preferred temperature unit - -k, kelvin Set Kelvin as preferred temperature unit - -e, email Set an administrative contact address for the Block Page - -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" + -p, password Set Admin Console password + -c, celsius Set Celsius as preferred temperature unit + -f, fahrenheit Set Fahrenheit as preferred temperature unit + -k, kelvin Set Kelvin as preferred temperature unit + -e, email Set an administrative contact address for the Block Page + -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 myname.tar.gz Backup configuration to archive with name myname.tar.gz as specified" exit 0 } @@ -640,12 +641,17 @@ Interfaces: } Teleporter() { - 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" + 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//./_}" + filename="pi-hole-${host:-noname}-teleporter_${datetimestamp}.tar.gz" + fi + php /var/www/html/admin/scripts/pi-hole/php/teleporter.php > "${filename}" } checkDomain() |