From 3c5c9a3f3c0a8424aa6e1f8af06492c971a658ab Mon Sep 17 00:00:00 2001 From: creme Date: Thu, 21 Nov 2024 18:59:33 +0100 Subject: [PATCH] freifunk-version: get ffdd-server 'install_dir' from uci --- salt/freifunk/base/ddmesh/usr/local/bin/freifunk-version | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/salt/freifunk/base/ddmesh/usr/local/bin/freifunk-version b/salt/freifunk/base/ddmesh/usr/local/bin/freifunk-version index 29c2c219..d8d3a9ca 100755 --- a/salt/freifunk/base/ddmesh/usr/local/bin/freifunk-version +++ b/salt/freifunk/base/ddmesh/usr/local/bin/freifunk-version @@ -1,8 +1,9 @@ #!/usr/bin/env bash -version="$(head -n3 /srv/ffdd-server/init_server.sh | grep -oP '(?<=^#version=).+' | tr -d '"')" -rev="$(cd /srv/ffdd-server && git describe --all --abbrev=0 | cut -f2 -d"/")" -commit="$(cd /srv/ffdd-server && git show --oneline -s | awk '{print $1}')" +install_dir="$(uci -qX get ffdd.sys.install_dir)" +version="$(head -n3 "$install_dir"/init_server.sh | grep -oP '(?<=^#version=).+' | tr -d '"')" +rev="$(cd "$install_dir" && git describe --all --abbrev=0 | cut -f2 -d"/")" +commit="$(cd "$install_dir" && git show --oneline -s | awk '{print $1}')" printf '%s - %s (%s)\n' "$version" "$rev" "$commit"