su_run: 3 attempts are added

This commit is contained in:
Mikhail Tergoev
2025-07-07 13:44:58 +03:00
parent f7450529c8
commit 63d24ae584

View File

@ -96,7 +96,7 @@ WH_MENU_CONFIG="$HOME/.config/menus/applications-merged/WineHelper.menu"
check_variables WINEESYNC "0"
check_variables WINEFSYNC "0"
check_variables WINEUSERNAME="xuser"
check_variables WINEUSERNAME "xuser"
check_variables WINEARCH "win64" # or "win32"
check_variables WH_WINE_USE "wine_x_tkg_10-0_amd64" # or system
@ -142,8 +142,13 @@ fi
##### ROOT #####
su_run () {
print_info "Для продолжения установки введите root пароль..."
su - -c "$@"
local i="1"
while [[ $i -le "3" ]] ; do
print_info "Для продолжения установки введите root пароль (попытка $i из 3)..."
su - -c "$@" && return 0
((i++))
done
return 1
}
##### CHECK DEPENDENCIES #####