#!/bin/bash

. ${TOOLKIT}-functions.sh

set -e -u

file="kubackup-run.conf"
input=$(filepath "$file")
output="$file.tmp"

customfile=$(filepath "custom-$file") || :

cp "$file" "$output"
if [ "X$customfile" != "X" ]
then
	echo -e "\n  $file: adding custom file '$customfile'\n"
	echo >>"$output"
	echo "# customfile: $customfile" >>"$output"
	echo >>"$output"
	cat "$customfile" >>"$output"
	echo >>"$output"
	echo "# customfile: $customfile EOF" >>"$output"
else
	echo -e "\n  $file: custom file 'custom-$file' not fond, skipped\n"
fi

echo "
# /etc/kubackup-run.conf EOF" >>"$output"

exit 0
