2) Delete update, keeping original as is
3) Interactively merge original with update
4) Show differences again
+5) Save update as example config
Please select from the menu above (-1 to ignore this update): "
my_input=$(read_int)
fi
;;
4) continue
;;
+ 5) do_distconf "${file}" "${ofile}"
+ ;;
*) continue
;;
esac
return 255
}
+do_distconf() {
+ # search for any previously saved distribution config
+ # files and number the current one accordingly
+
+ local file="${1}"
+ local ofile="${2}"
+ local -i count
+ local -i size
+ local -i fill
+ local -i f
+ local suffix
+ local efile
+
+ for count in $(seq 0 9999); do
+ size=${#count}
+ let fill=$((4-$size))
+ suffix=".dist_"
+ for f in $(seq 1 $fill); do
+ suffix+="0"
+ done
+ suffix+="${count}"
+ efile="${ofile}${suffix}"
+ if [[ ! -f ${efile} ]]; then
+ echo ${efile}
+ mv ${mv_opts} ${file} ${efile}
+ break
+ fi
+ done
+}
+
die() {
trap SIGTERM
trap SIGINT