Fix installer loop #523
This commit is contained in:
parent
1ebbe20bd7
commit
68a90dc684
|
@ -162,18 +162,18 @@ function interface_set_mode() {
|
||||||
|
|
||||||
function interface_reidentify() {
|
function interface_reidentify() {
|
||||||
if [ ${#@} -ne 2 ]; then return 1; fi
|
if [ ${#@} -ne 2 ]; then return 1; fi
|
||||||
|
|
||||||
local -r __interface_reidentify__oldIdentifier=$1
|
local -r __interface_reidentify__oldIdentifier=$1
|
||||||
local -r __interface_reidentify__newIdentifier=$2
|
local -r __interface_reidentify__newIdentifier=$2
|
||||||
|
|
||||||
if [[ $__interface_reidentify__newIdentifier == *" "* ]]
|
if [[ $__interface_reidentify__newIdentifier == *" "* ]]
|
||||||
then return 2
|
then return 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! interface_set_state $__interface_reidentify__oldIdentifier down
|
if ! interface_set_state $__interface_reidentify__oldIdentifier down
|
||||||
then return 3
|
then return 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: Add alternatives to 'ip' in case of failure.
|
# TODO: Add alternatives to 'ip' in case of failure.
|
||||||
ip link set $__interface_reidentify__oldIdentifier name $__interface_reidentify__newIdentifier
|
ip link set $__interface_reidentify__oldIdentifier name $__interface_reidentify__newIdentifier
|
||||||
return $?
|
return $?
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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."
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue