Bump coldair

This commit is contained in:
Philip Peterson 2026-06-08 04:42:27 -07:00
parent f0209fbdc8
commit 3687011061

32
bump-coldairnetworks.sh Executable file
View file

@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -euo pipefail
LINUX=/root/petersweb-infra/nixos/linux.nix
usage() {
echo "Usage: $0 <sha256-digest>"
echo " e.g. $0 sha256:2e2d92abae0ba68be780fff581523480ac05444690dbf38bf4330f1dda099e2a"
exit 1
}
[[ $# -eq 1 ]] || usage
NEW_DIGEST="${1#sha256:}" # strip leading "sha256:" if provided
# Validate: hex string of the right length
if ! [[ "$NEW_DIGEST" =~ ^[0-9a-f]{64}$ ]]; then
echo "Error: digest must be a 64-character lowercase hex string (got: $NEW_DIGEST)" >&2
exit 1
fi
OLD_LINE=$(grep -n 'coldairnetworks-com@sha256:' "$LINUX")
echo "Current: $OLD_LINE"
sed -i -E "s|(coldairnetworks-com@sha256:)[0-9a-f]{64}|\1${NEW_DIGEST}|" "$LINUX"
NEW_LINE=$(grep -n 'coldairnetworks-com@sha256:' "$LINUX")
echo "Updated: $NEW_LINE"
echo "Applying NixOS configuration..."
nixos-rebuild switch --flake /root/petersweb-infra/nixos#mainframe
echo "Done. Tail logs with: podman logs -f coldairnetworks"