Print version of pihole-FTL

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-06-07 18:45:24 +02:00
parent cf328c0af4
commit 7c0d828bb0
2 changed files with 18 additions and 2 deletions

View File

@@ -19,6 +19,10 @@
#include "dnsmasq.h" #include "dnsmasq.h"
#include <setjmp.h> #include <setjmp.h>
/* Pi-hole modification */
#include "../version.h"
/************************/
static volatile int mem_recover = 0; static volatile int mem_recover = 0;
static jmp_buf mem_jmp; static jmp_buf mem_jmp;
static int one_file(char *file, int hard_opt); static int one_file(char *file, int hard_opt);
@@ -4772,6 +4776,9 @@ void read_opts(int argc, char **argv, char *compile_opts)
add_txt("privacylevel.pihole", NULL, TXT_PRIVACYLEVEL); add_txt("privacylevel.pihole", NULL, TXT_PRIVACYLEVEL);
/************************/ /************************/
#endif #endif
/******** Pi-hole modification ********/
add_txt("version.FTL", GIT_VERSION, 0 );
/**************************************/
while (1) while (1)
{ {

View File

@@ -6,13 +6,16 @@ if [[ "${1}" != "pihole-FTL-linux-x86_64" ]]; then
fi fi
# Install necessary additional components for testing # Install necessary additional components for testing
apt install dns-utils apt install dnsutils -y
# Create necessary directories # Create necessary directories
mkdir -p /etc/pihole /var/run/pihole /var/log mkdir -p /etc/pihole /var/run/pihole /var/log
# We cannot bind to port
echo "port=50" > /etc/dnsmasq.conf
# Start FTL # Start FTL
./pihole-FTL project/pihole-FTL-linux-x86_64
# Prepare BATS # Prepare BATS
mkdir -p test/libs mkdir -p test/libs
@@ -23,6 +26,12 @@ git submodule add https://github.com/ztombol/bats-support test/libs/bats-support
# Block until FTL is ready, retry once per second for 45 seconds # Block until FTL is ready, retry once per second for 45 seconds
sleep 2 sleep 2
# Print versions of pihole-FTL
echo "FTL version:"
dig TXT CHAOS version.FTL @127.0.0.1 +short
echo "Contained dnsmasq version:"
dig TXT CHAOS version.bind @127.0.0.1 +short
# Print content of pihole-FTL.log # Print content of pihole-FTL.log
cat /var/log/pihole-FTL.log cat /var/log/pihole-FTL.log