#!/bin/bash
# Collector install script
#
# Copyright (c) 2021 Cisco Systems, Inc. and Tim Evens.  All rights reserved.
#
# Author: Tim Evens <tim@openbmp.org>

# Add build details
touch /usr/local/version-${VERSION}

#
# Defaults
#


# Disable interactive
export DEBIAN_FRONTEND=noninteractive

# Install base packages
apt-get update

# Fix ubuntu docker install
#sed -i 's/exit 101/exit 0/' /usr/sbin/policy-rc.d

# General depend install
apt-get install -y iproute2 wget zlib1g libssl1.1 libsasl2-2

# --
# -- Add host entries for reverse PTR lookups
# -- 
if [[ -f /config/hosts ]]; then
    cat /config/hosts >> /etc/hosts
fi

# -- 
# -- Clean up
# -- 
apt-get clean
rm -rf /var/lib/apt/lists/* /var/tmp/*
rm -f /tmp/install
