#!/bin/sh
set -eu

BRIDGE_NAME="${1:-warden0}"
GATEWAY="${2:-192.168.100.1}"

ifconfig "$BRIDGE_NAME" >/tmp/bastille-network-bridge.txt 2>/dev/null
grep -q "inet ${GATEWAY} " /tmp/bastille-network-bridge.txt
printf 'ok %s %s\n' "$BRIDGE_NAME" "$GATEWAY"
rm -f /tmp/bastille-network-bridge.txt
