This one can be easily fixed, on line 383 replace cat > "$newtemplate" <<EOF with cat >| "$newtemplate" <<EOF
There may be more instances of this problem though (trying to redirect to an existing file).
This one can be easily fixed, on line 383 replace
cat > "$newtemplate" <<EOF
with
cat >| "$newtemplate" <<EOF
There may be more instances of this problem though (trying to redirect to an existing file).