su_run: 3 attempts are added
This commit is contained in:
		
							
								
								
									
										11
									
								
								winehelper
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								winehelper
									
									
									
									
									
								
							| @@ -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 ##### | ||||
|   | ||||
		Reference in New Issue
	
	Block a user