Fluxion 5.4:

- Add dependencies check
    - Exit gracefully
This commit is contained in:
deltaxflux 2018-08-18 11:05:50 +02:00
parent 7dad0eaa25
commit 1072976153
2 changed files with 27 additions and 18 deletions

View File

@ -22,13 +22,14 @@ readonly FLUXIONNoiseFloor=-90
readonly FLUXIONNoiseCeiling=-60 readonly FLUXIONNoiseCeiling=-60
readonly FLUXIONVersion=5 readonly FLUXIONVersion=5
readonly FLUXIONRevision=2 readonly FLUXIONRevision=4
# Declare window ration bigger = smaller windows # Declare window ration bigger = smaller windows
FLUXIONWindowRatio=4 FLUXIONWindowRatio=4
# Allow to skip dependencies if required, not recommended # Allow to skip dependencies if required, not recommended
FLUXIONSkipDependencies=1 FLUXIONSkipDependencies=1
FLUXIONMissingDependencies=0
# ============================================================ # # ============================================================ #
# ================= < Script Sanity Checks > ================= # # ================= < Script Sanity Checks > ================= #
@ -279,7 +280,6 @@ fluxion_startup() {
"fuser:psmisc" "killall:psmisc" "fuser:psmisc" "killall:psmisc"
) )
if [ $FLUXIONSkipDependencies != 1 ];then
while ! installer_utils_check_dependencies requiredCLITools[@]; do while ! installer_utils_check_dependencies requiredCLITools[@]; do
if ! installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]; then if ! installer_utils_run_dependencies InstallerUtilsCheckDependencies[@]; then
echo echo
@ -288,6 +288,12 @@ fluxion_startup() {
read -r bullshit read -r bullshit
fi fi
done done
if [ $FLUXIONMissingDependencies -eq 1 ] && [ $FLUXIONSkipDependencies -eq 1 ];then
echo -e "\n\n"
format_center_literals "[ ${CSRed}Missing dependencies: try to install using ./fluxion.sh -i${CClr} ]"
echo -e "$FormatCenterLiterals"; sleep 3
exit 7
fi fi
echo -e "\\n\\n" # This echo is for spacing echo -e "\\n\\n" # This echo is for spacing
@ -1014,8 +1020,7 @@ fluxion_get_interface() {
# If only one interface exists and it's not unavailable, choose it. # If only one interface exists and it's not unavailable, choose it.
if [ "${#interfacesAvailable[@]}" -eq 1 -a \ if [ "${#interfacesAvailable[@]}" -eq 1 -a \
"${interfacesAvailableState[0]}" != "[-]" -a \ "${interfacesAvailableState[0]}" != "[-]" -a \
"$skipOption" == "" ]; then "$skipOption" == "" ]; then FluxionInterfaceSelected="${interfacesAvailable[0]}"
FluxionInterfaceSelected="${interfacesAvailable[0]}"
FluxionInterfaceSelectedState="${interfacesAvailableState[0]}" FluxionInterfaceSelectedState="${interfacesAvailableState[0]}"
FluxionInterfaceSelectedInfo="${interfacesAvailableInfo[0]}" FluxionInterfaceSelectedInfo="${interfacesAvailableInfo[0]}"
break break

View File

@ -218,7 +218,11 @@ installer_utils_check_dependencies() {
if ! hash "$__installer_utils_check_dependencies__CLITool" 2>/dev/null; then if ! hash "$__installer_utils_check_dependencies__CLITool" 2>/dev/null; then
__installer_utils_check_dependencies__state="$CRed Missing!$CClr" __installer_utils_check_dependencies__state="$CRed Missing!$CClr"
if [ $FLUXIONSkipDependencies -eq 0 ];then
InstallerUtilsCheckDependencies+=("$__installer_utils_check_dependencies__CLIToolInfo") InstallerUtilsCheckDependencies+=("$__installer_utils_check_dependencies__CLIToolInfo")
else
FLUXIONMissingDependencies=1
fi
fi fi
format_center_literals "$InstallerUtilsNoticeMark ${__installer_utils_check_dependencies__identifier// /.}$__installer_utils_check_dependencies__state" format_center_literals "$InstallerUtilsNoticeMark ${__installer_utils_check_dependencies__identifier// /.}$__installer_utils_check_dependencies__state"