#!/bin/bash

set -e

#
# Skip, if we are not in "configure" state
#
if [ "$1" != "configure" ]; then
    echo "I: Skipping configuration"
    exit 0
fi

#
#  Add the current keys
#
for i in /usr/share/bytemark-keys/*.pub; do
  apt-key add $i > /dev/null 2>&1 || echo "I: Failed to add key $i"
done

#
# Remove any old keys
#
for i in 9703BD62 F3562818 6734A3BF 23E96D7D ; do
  apt-key del $i > /dev/null 2>&1 || echo "I: Key ID $i was not found, and not removed"
done

#DEBHELPER#
exit 0
