Browse Source

Use manifest for cron

main
Björn Pettersson 3 years ago
parent
commit
b1d8fa7ba4
  1. 8
      cron-scripts/10-test.sh
  2. 4
      cron-scripts/cron-manifest.scm

8
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

4
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"))
Loading…
Cancel
Save