diff --git a/winehelper b/winehelper index 53d3a1c..69b53ad 100755 --- a/winehelper +++ b/winehelper @@ -335,10 +335,26 @@ check_file_sum () { fi } -print_license_agreement () { - if [[ -f "$license_agreement_file" ]] \ - && [[ "$(stat -c %a "$license_agreement_file" 2>/dev/null)" == "600" ]] - then return 0 +print_license_agreement() { + if [[ -f "$license_agreement_file" ]] && + [[ "$(stat -c %a "$license_agreement_file" 2>/dev/null)" == "600" ]] ; then + return 0 + fi + + setup_agreement() { + touch "$license_agreement_file" + chmod 600 "$license_agreement_file" + + cleanup_laf() { + local cleanup_laf_dir="$(dirname "$license_agreement_file")" + rm -r "$cleanup_laf_dir" || echo "Не удалось удалить каталог $cleanup_laf_dir" + } + trap "cleanup_laf" EXIT + } + + if [[ -n "$GUI_MODE" ]] ; then + setup_agreement + return 0 fi echo @@ -356,13 +372,7 @@ print_license_agreement () { " if print_confirmation "Подтвердите продолжение установки" ; then - touch "$license_agreement_file" - chmod 600 "$license_agreement_file" - cleanup_laf () { - local cleanup_laf_dir="$(dirname "$license_agreement_file")" - rm -r "$cleanup_laf_dir" || echo "Не удалось удалить каталог $cleanup_laf_dir" - } - trap "cleanup_laf" EXIT + setup_agreement return 0 else exit 1