]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
scripts/poe-tasks: env vars are accessible by all tasks using _env.sh
authorAleš Mrázek <ales.mrazek@nic.cz>
Mon, 5 Aug 2024 13:24:05 +0000 (15:24 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Mon, 26 Aug 2024 12:28:10 +0000 (14:28 +0200)
scripts/poe-tasks/_env.sh
scripts/poe-tasks/run

index 5f38a27be1932e7174073be95463de26a2ca9566..1ea73a3962a58e070a626548dcc79913be73155b 100644 (file)
@@ -34,6 +34,23 @@ PATH="$PATH:$gitroot/node_modules/.bin"
 # fail even on unbound variables
 set -o nounset
 
+# create runtime directories
+if [ -z "${KRES_CONFIG_DIR:-}" ]; then
+       KRES_CONFIG_DIR="$gitroot/etc/config"
+fi
+mkdir -p "$KRES_CONFIG_DIR/runtime" "$KRES_CONFIG_DIR/cache"
+
+# env variables
+if [ -z "${KRES_MANAGER_CONFIG:-}" ]; then
+    KRES_MANAGER_CONFIG="$KRES_CONFIG_DIR/config.dev.yaml"
+fi
+
+if [ -z "${KRES_MANAGER_API_SOCK:-}" ]; then
+    KRES_MANAGER_API_SOCK="$KRES_CONFIG_DIR/manager.sock"
+fi
+export KRES_MANAGER_CONFIG
+export KRES_MANAGER_API_SOCK
+
 function build_kresd {
        if [ -d .build_kresd ]; then
                echo
index f217988da6b4a199587ad56cb9f481842434d82c..907f94c10ec5b1758287116cf06020ed91b2120f 100755 (executable)
@@ -22,23 +22,8 @@ shopt -u globstar
 shopt -u nullglob
 
 echo
-echo Knot Manager API is accessible on http://localhost:5000
-echo -------------------------------------------------------
+echo The Knot Resolver management API is accessible on http://localhost:5000
+echo -----------------------------------------------------------------------
 
-# create runtime directories
-if [ -z "${KRES_CONFIG_DIR:-}" ]; then
-    KRES_CONFIG_DIR="etc/config"
-fi
-mkdir -p "$KRES_CONFIG_DIR/runtime" "$KRES_CONFIG_DIR/cache"
-
-if [ -z "${KRES_MANAGER_CONFIG:-}" ]; then
-    KRES_MANAGER_CONFIG="$KRES_CONFIG_DIR/config.dev.yaml"
-fi
-
-if [ -z "${KRES_MANAGER_API_SOCK:-}" ]; then
-    KRES_MANAGER_API_SOCK="$KRES_CONFIG_DIR/manager.sock"
-fi
-
-export KRES_MANAGER_CONFIG
-export KRES_MANAGER_API_SOCK
+# run the knot-resolver manager
 python3 -m knot_resolver_manager $@