From b1d8fa7ba47cf07dc08b058b72fd95b49347a648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Pettersson?= Date: Sun, 4 Jun 2023 23:54:48 +0200 Subject: [PATCH] Use manifest for cron --- cron-scripts/10-test.sh | 8 +++++--- cron-scripts/cron-manifest.scm | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 cron-scripts/cron-manifest.scm diff --git a/cron-scripts/10-test.sh b/cron-scripts/10-test.sh index 331409b..5256548 100755 --- a/cron-scripts/10-test.sh +++ b/cron-scripts/10-test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env -S guix shell bash -- bash +#!/usr/bin/env -S guix shell --manifest=cron-manifest.scm -- bash test -e /tmp/cron-10-test.sh.lock && find /tmp/cron-10-test.sh.lock -cmin +10 -delete @@ -13,16 +13,18 @@ touch /tmp/cron-10-test.sh.lock set -x +INVENTORY_FILE=/data/xhrpb-guix-config/inventory + mac=$(ip link show | awk '/link\/ether/{ print $2 }' | head -n1 | sed 's/://g') -hostname=$(grep "^$mac" inventory | awk '{ print $2 }') +hostname=$(grep "^$mac" "$INVENTORY_FILE" | awk '{ print $2 }') if test -z "$hostname" then hostname=guix-template fi -host_conf=$(hostname).scm +host_conf=${hostname}.scm cd /data/xhrpb-guix-config diff --git a/cron-scripts/cron-manifest.scm b/cron-scripts/cron-manifest.scm new file mode 100644 index 0000000..88a1e80 --- /dev/null +++ b/cron-scripts/cron-manifest.scm @@ -0,0 +1,4 @@ +(use-modules (gnu packages linux) ;for 'ip' + (gnu packages version-control)) ;for 'git' + +(specifications->manifest '("bash" "iproute2" "git"))