ddns-scripts: write version string during installation into file
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 16 Sep 2020 13:54:35 +0000 (15:54 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Mon, 21 Sep 2020 08:17:01 +0000 (10:17 +0200)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/ddns-scripts/Makefile
net/ddns-scripts/files/dynamic_dns_functions.sh

index d432364e1296d3c3d644104441accecac60f6936..1f22997f595e4acccc8c748f23fd0833d999cbcc 100755 (executable)
@@ -183,6 +183,9 @@ define Package/ddns-scripts/install
        $(INSTALL_DIR)  $(1)/etc/config
        $(INSTALL_CONF) $(PKG_BUILD_DIR)/files/ddns.config $(1)/etc/config/ddns
 
+       $(INSTALL_DIR) $(1)/usr/share/ddns
+       echo "$(PKG_VERSION)-$(PKG_RELEASE)" > $(1)/usr/share/ddns/version
+
        $(INSTALL_DIR)  $(1)/usr/share/ddns/services
        $(INSTALL_DATA) ./files/usr/share/ddns/services/* \
                $(1)/usr/share/ddns/services/
index b5dc144ca183759a19a21c46d411fc357b5f7346..4a994ebc7ee0b57a9ef8e3e567263376584f4b6c 100755 (executable)
 . /lib/functions/network.sh
 
 # GLOBAL VARIABLES #
-VERSION="2.7.8-14"
+if [ -f "/usr/share/ddns/version" ]; then
+       VERSION="$(cat "/usr/share/ddns/version")"
+else
+       VERSION="unknown"
+fi
 SECTION_ID=""          # hold config's section name
 VERBOSE=0              # default mode is log to console, but easily changed with parameter
 MYPROG=$(basename $0)  # my program call name