Fix installer loop #523

This commit is contained in:
deltaxflux 2018-05-30 00:38:10 +02:00
parent 1ebbe20bd7
commit 68a90dc684
7 changed files with 34 additions and 12 deletions

View File

@ -210,7 +210,6 @@ function installer_utils_check_dependencies() {
local __installer_utils_run_dependencies__CLIToolsInfo=("${!1}") local __installer_utils_run_dependencies__CLIToolsInfo=("${!1}")
InstallerUtilsCheckDependencies=() InstallerUtilsCheckDependencies=()
local __installer_utils_run_dependencies__CLIToolInfo
for __installer_utils_run_dependencies__CLIToolInfo in "${__installer_utils_run_dependencies__CLIToolsInfo[@]}"; do for __installer_utils_run_dependencies__CLIToolInfo in "${__installer_utils_run_dependencies__CLIToolsInfo[@]}"; do
local __installer_utils_run_dependencies__CLITool=${__installer_utils_run_dependencies__CLIToolInfo/:*/} local __installer_utils_run_dependencies__CLITool=${__installer_utils_run_dependencies__CLIToolInfo/:*/}
local __installer_utils_run_dependencies__identifier="$(printf "%-44s" "$__installer_utils_run_dependencies__CLITool")" local __installer_utils_run_dependencies__identifier="$(printf "%-44s" "$__installer_utils_run_dependencies__CLITool")"
@ -236,8 +235,7 @@ function installer_utils_run_dependencies() {
echo -e "\n\n$FormatCenterLiterals" echo -e "\n\n$FormatCenterLiterals"
format_center_literals "[ ${CSRed}CANNOT CONTINUE${CClr} ]" format_center_literals "[ ${CSRed}CANNOT CONTINUE${CClr} ]"
echo -e "$FormatCenterLiterals" echo -e "$FormatCenterLiterals"; sleep 3
sleep 5
return 3 return 3
fi fi
@ -254,21 +252,25 @@ function installer_utils_run_dependencies() {
done done
if [ ! "$PackageManagerCLT" ]; then if [ ! "$PackageManagerCLT" ]; then
format_center_literals "${CRed}[ ~ No Suitable Package Manager Found ~ ]$CClr" format_center_literals "${CRed}[ ~ No Suitable Package Manager Found ~ ]$CClr";echo
echo
sleep 3 sleep 3
return 2 return 2
fi fi
check_package_manager
prep_package_manager prep_package_manager
for __installer_utils_run_dependencies__dependencyInfo in "${__installer_utils_run_dependencies__dependenciesInfo[@]}"; do for __installer_utils_run_dependencies__dependencyInfo in "${__installer_utils_run_dependencies__dependenciesInfo[@]}"; do
local __installer_utils_run_dependencies__target=${__installer_utils_run_dependencies__dependencyInfo/:*/} local __installer_utils_run_dependencies__target=${__installer_utils_run_dependencies__dependencyInfo/:*/}
local __installer_utils_run_dependencies__packages=${__installer_utils_run_dependencies__dependencyInfo/*:/} local __installer_utils_run_dependencies__packages=${__installer_utils_run_dependencies__dependencyInfo/*:/}
k=${#__installer_utils_run_dependencies__packages[@]};i=1
for __installer_utils_run_dependencies__package in ${__installer_utils_run_dependencies__packages//|/ }; do for __installer_utils_run_dependencies__package in ${__installer_utils_run_dependencies__packages//|/ }; do
clear clear
if $PackageManagerCLT $PackageManagerCLTInstallOptions $__installer_utils_run_dependencies__package; then break if $PackageManagerCLT $PackageManagerCLTInstallOptions $__installer_utils_run_dependencies__package; then break; fi
fi if [ $k -eq $i ];then clear; echo -e "[\033[31m!\033[0m] Can't install all dependencies, quitting..."; sleep 2; fluxion_shutdown; fi
i=$(echo $(($i+1)))
done done
done done

View File

@ -13,6 +13,10 @@ if [ -f "/etc/debian_version" ]; then
echo "$(cat /etc/apt/sources.list | grep -v 'deb http://http.kali.org/kali kali-rolling main non-free contrib # Installed By FLUXION')" >/etc/apt/sources.list echo "$(cat /etc/apt/sources.list | grep -v 'deb http://http.kali.org/kali kali-rolling main non-free contrib # Installed By FLUXION')" >/etc/apt/sources.list
} }
check_package_manager() {
echo "Nothing to check." >$PackageManagerOutputDevice
}
prep_package_manager() { prep_package_manager() {
if [ ! "$(cat /etc/apt/sources.list | egrep 'deb http://http.kali.org/kali ((kali-rolling|main|contrib|non-free) )*')" ]; then if [ ! "$(cat /etc/apt/sources.list | egrep 'deb http://http.kali.org/kali ((kali-rolling|main|contrib|non-free) )*')" ]; then
echo "Adding missing sources to package manager, please wait." echo "Adding missing sources to package manager, please wait."

View File

@ -13,6 +13,10 @@ if [ -f "/etc/gentoo-release" ]; then
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }
check_package_manager() {
echo "Nothing to check." >$PackageManagerOutputDevice
}
prep_package_manager() { prep_package_manager() {
echo "Nothing to prepare." >$PackageManagerOutputDevice echo "Nothing to prepare." >$PackageManagerOutputDevice
} }

View File

@ -21,6 +21,10 @@ if [ -f "/etc/arch-release" ]; then
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }
check_package_manager() {
if [ -f "/var/lib/pacman/db.lck" ];then echo -e "[\033[31m!\033[0m] Pacman is locked, can't install dependencies. Exit."; exit 4; fi
}
prep_package_manager() { prep_package_manager() {
echo "Nothing to prepare." >$PackageManagerOutputDevice echo "Nothing to prepare." >$PackageManagerOutputDevice
} }

View File

@ -13,6 +13,10 @@ if [ -f "/etc/redhat-release" ]; then
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }
check_package_manager () {
echo "Nothing to check." >$PackageManagerOutputDevice
}
prep_package_manager() { prep_package_manager() {
echo "Nothing to prepare." >$PackageManagerOutputDevice echo "Nothing to prepare." >$PackageManagerOutputDevice
} }

View File

@ -13,6 +13,10 @@ if [ -f "/etc/SuSE-release" ]; then
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }
check_package_manager() {
echo "Nothing to check." >$PackageManagerOutputDevice
}
prep_package_manager() { prep_package_manager() {
echo "Nothing to prepare." >$PackageManagerOutputDevice echo "Nothing to prepare." >$PackageManagerOutputDevice
} }