added license acceptance when installing the graphical user interface #38

Closed
minergenon wants to merge 1 commits from minergenon:gui_license into master
Showing only changes of commit 9c26abdf07 - Show all commits

View File

@@ -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