From ea3dda68842a7849bfbfeec639d6cc7f3c733b8d Mon Sep 17 00:00:00 2001
From: Recolic K <bensl@microsoft.com>
Date: Thu, 22 Jul 2021 16:07:22 +0800
Subject: [PATCH] new version

---
 Dockerfile                  | 2 +-
 datafile_gen_daemon_conf.py | 1 +
 do.bash                     | 6 +++++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index d1dd106..1647109 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,7 +3,7 @@ FROM ubuntu:20.04
 MAINTAINER root@recolic.net
 
 RUN apt update
-RUN apt install -y curl netcat iputils-ping python3.8
+RUN DEBIAN_FRONTEND=noninteractive apt install -y curl netcat iputils-ping python3.8 dnsutils
 RUN ln -s /usr/bin/python3.8 /usr/bin/python3
 # RUN pacman -Sy
 # RUN pacman -S --noconfirm curl netcat iputils grep
diff --git a/datafile_gen_daemon_conf.py b/datafile_gen_daemon_conf.py
index 968d722..9df5f31 100644
--- a/datafile_gen_daemon_conf.py
+++ b/datafile_gen_daemon_conf.py
@@ -20,6 +20,7 @@ tests = [
         ('./do.bash shortlink', 'Short Link'), 
         ('./do.bash cc-dns', 'recolic.cc DNS'), 
         ('./do.bash home-http', 'Home NAS & DDNS & HTTP'), 
+        ('./do.bash domain2ip', 'Domain to IP'), 
         ]
 # ('./do.bash ddns-home', 'DDNS home'), 
 
diff --git a/do.bash b/do.bash
index e2eae8e..6b4529c 100755
--- a/do.bash
+++ b/do.bash
@@ -153,6 +153,9 @@ function do_test () {
             # NO icmp required.
             curl -L https://recolic.net/hms.php | grep betterlisting || return $?
             ;;
+        domain2ip )
+            dig +short 1.1.1.1.ip.recolic.cc | grep 1.1.1.1 || return $?
+            ;;
         * )
             echo PROGRAMMING ERROR: NO TARGET "$1" available. 
             return 1
@@ -186,7 +189,8 @@ if [[ "$1" = all ]]; then
     do_test_twice shortlink &&
     do_test_twice dl &&
     do_test_twice cc-dns &&
-    do_test_twice home-http
+    do_test_twice home-http &&
+    do_test_twice domain2ip
     exit $?
 fi
 
-- 
GitLab