#!/bin/sh -e

BACKUP_SERVER_CONFIG=/etc/sysconfig/backup-server

. bacula-sh-functions
[ ! -s "$BACKUP_SERVER_CONFIG" ] || . "$BACKUP_SERVER_CONFIG"

[ "$STORAGE_IFACE_CONFIGURATION" = "dhcp" ] || exit 0
[ "${interface}" = "$STORAGE_IFACE_NAME" ] || exit 0
[ "${new_ip_address}" != "$(bacula_storage_get_address)" ] || exit 0

bacula_storage_set_address "${new_ip_address}"
service bacula-dir condreload
