#!/bin/bash

# This script is used to remove source files created by FAI.
#
# We manage apt source files using puppet apt module, After the first
# puppet run we need to clean the sources files created during FAI.
# Otherwise apt update will give source duplicate errors
#

files=("/etc/apt/sources.list.d/backports.list"
       "/etc/apt/sources.list"
       "/etc/apt/preferences.d/backports")


for file in "${files[@]}"
do
    rm "$file"
done

apt update

exit

# Documentation.  Use a hack to hide this from the shell.  Because of the
# above exit line, this should never be executed.
DOCS=<<__END_OF_DOCS__

=head1 NAME

fai-apt-sources-clean - script to remove source files created by FAI.

=head1 DESCRIPTION

This script is used to remove source files created by FAI.

We manage apt source files using puppet apt module, After the first
puppet run we need to clean the sources files created during FAI.
Otherwise apt update will give source duplicate errors

=head1 AUTHOR

Srinivas Rao Puttagunta <psr123@stanford.edu>

=cut

__END_OF_DOCS__
