added license acceptance when installing the graphical user interface #38

Closed
minergenon wants to merge 1 commits from minergenon:gui_license into master

View File

@@ -335,10 +335,26 @@ check_file_sum () {
fi fi
} }
print_license_agreement () { print_license_agreement() {
if [[ -f "$license_agreement_file" ]] \ if [[ -f "$license_agreement_file" ]] &&
&& [[ "$(stat -c %a "$license_agreement_file" 2>/dev/null)" == "600" ]] [[ "$(stat -c %a "$license_agreement_file" 2>/dev/null)" == "600" ]] ; then
then return 0 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 fi
echo echo
@@ -356,13 +372,7 @@ print_license_agreement () {
" "
if print_confirmation "Подтвердите продолжение установки" ; then if print_confirmation "Подтвердите продолжение установки" ; then
touch "$license_agreement_file" setup_agreement
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
return 0 return 0
else else
exit 1 exit 1