diff --git a/lib/setup/setup b/lib/setup/setup index c814d31..a41601f 100644 --- a/lib/setup/setup +++ b/lib/setup/setup @@ -11,5 +11,72 @@ Completion is available for prompts asking for a paths or filenames. setupSource setupDestinations unset expr - exit + writeConfig >"$cffile".tmp + unset \ + sourcepath \ + skippeddirectories \ + maxload \ + loadinterval \ + ionice \ + tempdir \ + database \ + debug \ + destinationchannels \ + destinationfat32compat \ + destinationcopymime \ + destinationformat \ + destinationfrequency \ + destinationid \ + destinationloss \ + destinationmaxbps \ + destinationnormalize \ + destinationpath \ + destinationquality \ + destinationrename \ + destinationnoresample \ + destinationrenamepath \ + destinationskipmime + declare -A \ + destinationchannels \ + destinationfat32compat \ + destinationcopymime \ + destinationformat \ + destinationfrequency \ + destinationid \ + destinationloss \ + destinationmaxbps \ + destinationnormalize \ + destinationpath \ + destinationquality \ + destinationrename \ + destinationnoresample \ + destinationrenamepath \ + destinationskipmime + oldcffile="$cffile" + cffile="$cffile".tmp + getConfig + { + echo $'Please review your new configuration:\n' + printConfig + }| less -F -e + cffile="$oldcffile" + read -p'Write config file? [y/N] ' do_write + case $do_write in + y) + mv -f "$cffile".tmp "$cffile" + ;; + *) + rm "$cffile".tmp + read -p'Re-run (s)etup, (q)uit [s/Q] ' do_rerun + case $do_rerun in + s) setup ;; + *) exit ;; + esac + ;; + esac + read -p'Run now? [Y/n] ' do_run + case $do_run in + n) exit ;; + *) ;; + esac }