#!/bin/bash
#
# __copy1__
# __copy2__
#
CMD=$(basename $0)


usage()
{
	echo "
usage: $CMD [--all]

* remove downloaded automatic config files
* use --all to remove auto distro files, too (auto.00*)
" >&2
	exit 1
}

# (MAIN)

f_all=false

case $1 in
 -a|--all)	f_all=true; shift ;;
 -*)		usage ;;
esac

[ $# != 0 ] && usage

cd __CONF__ || exit $?

echo -n "  purging auto config data ... "
rm -f timestamp config-timestamp config-urls \
	conf.d/auto.[0-9][1-9]* conf.d/auto.[1-9][0-9]*
echo "ok"

$f_all && {
	echo -n "  purging distro config data ... "
	rm -f conf.d/auto.*
	echo "ok"
}

exit 0
