Fixed installer bugs suppressed by bash bug.

A bash was caused by a read-only variable overwritten when using source.
The installer will now ask the user before attempting installation again.
This commit is contained in:
Matias Barcenas 2018-05-29 17:44:53 -05:00
parent 1ebbe20bd7
commit ccb9c919b1
7 changed files with 40 additions and 29 deletions

View File

@ -22,7 +22,7 @@ readonly FLUXIONNoiseFloor=-90
readonly FLUXIONNoiseCeiling=-60 readonly FLUXIONNoiseCeiling=-60
readonly FLUXIONVersion=4 readonly FLUXIONVersion=4
readonly FLUXIONRevision=11 readonly FLUXIONRevision=12
# Declare window ration bigger = smaller windows # Declare window ration bigger = smaller windows
FLUXIONWindowRatio=4 FLUXIONWindowRatio=4
@ -275,7 +275,12 @@ fluxion_startup() {
) )
while ! installer_utils_check_dependencies requiredCLITools[@]; do while ! installer_utils_check_dependencies requiredCLITools[@]; do
installer_utils_run_dependencies InstallerUtilsCheckDependencies[@] if ! installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]; then
echo
echo -e "${CRed}Dependency installation failed!$CClr"
echo "Press enter to retry, ctrl+c to exit..."
read bullshit
fi
done done
echo -e "\n\n" # This echo is for spacing echo -e "\n\n" # This echo is for spacing

View File

@ -207,21 +207,21 @@ function installer_utils_run_update() {
function installer_utils_check_dependencies() { function installer_utils_check_dependencies() {
if [ ! "$1" ]; then return 1; fi if [ ! "$1" ]; then return 1; fi
local __installer_utils_run_dependencies__CLIToolsInfo=("${!1}") local __installer_utils_check_dependencies__CLIToolsInfo=("${!1}")
InstallerUtilsCheckDependencies=() InstallerUtilsCheckDependencies=()
local __installer_utils_run_dependencies__CLIToolInfo local __installer_utils_check_dependencies__CLIToolInfo
for __installer_utils_run_dependencies__CLIToolInfo in "${__installer_utils_run_dependencies__CLIToolsInfo[@]}"; do for __installer_utils_check_dependencies__CLIToolInfo in "${__installer_utils_check_dependencies__CLIToolsInfo[@]}"; do
local __installer_utils_run_dependencies__CLITool=${__installer_utils_run_dependencies__CLIToolInfo/:*/} local __installer_utils_check_dependencies__CLITool=${__installer_utils_check_dependencies__CLIToolInfo/:*/}
local __installer_utils_run_dependencies__identifier="$(printf "%-44s" "$__installer_utils_run_dependencies__CLITool")" local __installer_utils_check_dependencies__identifier="$(printf "%-44s" "$__installer_utils_check_dependencies__CLITool")"
local __installer_utils_run_dependencies__state=".....$CGrn OK.$CClr" local __installer_utils_check_dependencies__state=".....$CGrn OK.$CClr"
if ! hash "$__installer_utils_run_dependencies__CLITool" 2>/dev/null; then if ! hash "$__installer_utils_check_dependencies__CLITool" 2>/dev/null; then
__installer_utils_run_dependencies__state="$CRed Missing!$CClr" __installer_utils_check_dependencies__state="$CRed Missing!$CClr"
InstallerUtilsCheckDependencies+=("$__installer_utils_run_dependencies__CLIToolInfo") InstallerUtilsCheckDependencies+=("$__installer_utils_check_dependencies__CLIToolInfo")
fi fi
format_center_literals "$InstallerUtilsNoticeMark ${__installer_utils_run_dependencies__identifier// /.}$__installer_utils_run_dependencies__state" format_center_literals "$InstallerUtilsNoticeMark ${__installer_utils_check_dependencies__identifier// /.}$__installer_utils_check_dependencies__state"
echo -e "$FormatCenterLiterals" echo -e "$FormatCenterLiterals"
done done
@ -245,7 +245,7 @@ function installer_utils_run_dependencies() {
# The array below holds all the packages that will be installed. # The array below holds all the packages that will be installed.
local __installer_utils_run_dependencies__dependenciesInfo=("${!1}") local __installer_utils_run_dependencies__dependenciesInfo=("${!1}")
local __installer_utils_run_dependencies__managers=(lib/installer/managers/*) local __installer_utils_run_dependencies__managers=("$FLUXIONLibPath/installer/managers/"*)
local __installer_utils_run_dependencies__manager local __installer_utils_run_dependencies__manager
for __installer_utils_run_dependencies__manager in "${__installer_utils_run_dependencies__managers[@]}"; do for __installer_utils_run_dependencies__manager in "${__installer_utils_run_dependencies__managers[@]}"; do
@ -262,17 +262,33 @@ function installer_utils_run_dependencies() {
prep_package_manager prep_package_manager
unset __installer_utils_run_dependencies__installerStatus
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/*:/}
unset __installer_utils_run_dependencies__packageStatus
local __installer_utils_run_dependencies__package
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
local __installer_utils_run_dependencies__packageStatus="installed"
break
fi fi
done done
if [ -z ${__installer_utils_run_dependencies__packageStatus+x} ]; then
__installer_utils_run_dependencies__installerStatus="failed"
break
fi
done done
unprep_package_manager unprep_package_manager
if [ "$__installer_utils_run_dependencies__installerStatus" = "failed" ]; then
return 3
fi
} }
# FLUXSCRIPT END # FLUXSCRIPT END

View File

@ -7,8 +7,6 @@ if [ -f "/etc/debian_version" ]; then
PackageManagerOutputDevice="/dev/stdout" PackageManagerOutputDevice="/dev/stdout"
PackageManagerLog="/tmp/lib_package_manager.log"
unprep_package_manager() { unprep_package_manager() {
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
} }
@ -33,11 +31,11 @@ if [ -f "/etc/debian_version" ]; then
fi fi
# Cleanup package manager # Cleanup package manager
sudo apt-get install -f -y | tee -a $PackageManagerLog apt-get install -f -y | tee -a $PackageManagerLog
sudo apt-get autoremove -y | tee -a $PackageManagerLog apt-get autoremove -y | tee -a $PackageManagerLog
sudo apt-get autoclean -y | tee -a $PackageManagerLog apt-get autoclean -y | tee -a $PackageManagerLog
sudo apt-get clean -y | tee -a $PackageManagerLog apt-get clean -y | tee -a $PackageManagerLog
sudo apt-get update | tee -a $PackageManagerLog apt-get update | tee -a $PackageManagerLog
} }
fi fi

View File

@ -7,8 +7,6 @@ if [ -f "/etc/gentoo-release" ]; then
PackageManagerOutputDevice="/dev/stdout" PackageManagerOutputDevice="/dev/stdout"
PackageManagerLog="/tmp/lib_package_manager.log"
unprep_package_manager() { unprep_package_manager() {
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }

View File

@ -15,8 +15,6 @@ if [ -f "/etc/arch-release" ]; then
PackageManagerOutputDevice="/dev/stdout" PackageManagerOutputDevice="/dev/stdout"
PackageManagerLog="/tmp/lib_package_manager.log"
unprep_package_manager() { unprep_package_manager() {
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }

View File

@ -7,8 +7,6 @@ if [ -f "/etc/redhat-release" ]; then
PackageManagerOutputDevice="/dev/stdout" PackageManagerOutputDevice="/dev/stdout"
PackageManagerLog="/tmp/lib_package_manager.log"
unprep_package_manager() { unprep_package_manager() {
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }

View File

@ -7,8 +7,6 @@ if [ -f "/etc/SuSE-release" ]; then
PackageManagerOutputDevice="/dev/stdout" PackageManagerOutputDevice="/dev/stdout"
PackageManagerLog="/tmp/lib_package_manager.log"
unprep_package_manager() { unprep_package_manager() {
echo "Nothing to unprepare." >$PackageManagerOutputDevice echo "Nothing to unprepare." >$PackageManagerOutputDevice
} }