From dc0ab6d855d6e5d4bc443e17cf84eacc6b1f8583 Mon Sep 17 00:00:00 2001 From: Matias Barcenas Date: Tue, 13 Mar 2018 16:01:28 -0500 Subject: [PATCH] Fixed scope bug with installer definitions + posix functions. --- fluxion.sh | 3 ++- lib/installer/managers/apt.sh | 4 ++-- lib/installer/managers/emerge.sh | 4 ++-- lib/installer/managers/pacman.sh | 4 ++-- lib/installer/managers/yum.sh | 4 ++-- lib/installer/managers/zypp.sh | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/fluxion.sh b/fluxion.sh index 12ccf36..319915e 100755 --- a/fluxion.sh +++ b/fluxion.sh @@ -321,7 +321,8 @@ fluxion_shutdown() { echo -e "$CWht[$CRed-$CWht] "$( io_dynamic_output "$FLUXIONRestoringPackageManagerNotice" )"$CClr" - unprep_package_manager + # Notice: The package manager has already been restored at this point. + # InstallerUtils assures the manager is restored after running operations. fi # If allocated interfaces exist, deallocate them now. diff --git a/lib/installer/managers/apt.sh b/lib/installer/managers/apt.sh index 0fd5053..bbf9b9e 100755 --- a/lib/installer/managers/apt.sh +++ b/lib/installer/managers/apt.sh @@ -9,11 +9,11 @@ if [ -f "/etc/debian_version" ]; then PackageManagerLog="/tmp/lib_package_manager.log" - function 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 } - function 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 echo "Adding missing sources to package manager, please wait." diff --git a/lib/installer/managers/emerge.sh b/lib/installer/managers/emerge.sh index bbe741e..4bd7871 100755 --- a/lib/installer/managers/emerge.sh +++ b/lib/installer/managers/emerge.sh @@ -9,11 +9,11 @@ if [ -f "/etc/gentoo-release" ]; then PackageManagerLog="/tmp/lib_package_manager.log" - function unprep_package_manager() { + unprep_package_manager() { echo "Nothing to unprepare." >$PackageManagerOutputDevice } - function prep_package_manager() { + prep_package_manager() { echo "Nothing to prepare." >$PackageManagerOutputDevice } fi diff --git a/lib/installer/managers/pacman.sh b/lib/installer/managers/pacman.sh index ad1129b..30d74e4 100755 --- a/lib/installer/managers/pacman.sh +++ b/lib/installer/managers/pacman.sh @@ -17,11 +17,11 @@ if [ -f "/etc/arch-release" ]; then PackageManagerLog="/tmp/lib_package_manager.log" - function unprep_package_manager() { + unprep_package_manager() { echo "Nothing to unprepare." >$PackageManagerOutputDevice } - function prep_package_manager() { + prep_package_manager() { echo "Nothing to prepare." >$PackageManagerOutputDevice } fi diff --git a/lib/installer/managers/yum.sh b/lib/installer/managers/yum.sh index fd88610..b3edbc8 100755 --- a/lib/installer/managers/yum.sh +++ b/lib/installer/managers/yum.sh @@ -9,11 +9,11 @@ if [ -f "/etc/redhat-release" ]; then PackageManagerLog="/tmp/lib_package_manager.log" - function unprep_package_manager() { + unprep_package_manager() { echo "Nothing to unprepare." >$PackageManagerOutputDevice } - function prep_package_manager() { + prep_package_manager() { echo "Nothing to prepare." >$PackageManagerOutputDevice } fi diff --git a/lib/installer/managers/zypp.sh b/lib/installer/managers/zypp.sh index 084c790..d4b92f5 100755 --- a/lib/installer/managers/zypp.sh +++ b/lib/installer/managers/zypp.sh @@ -9,11 +9,11 @@ if [ -f "/etc/SuSE-release" ]; then PackageManagerLog="/tmp/lib_package_manager.log" - function unprep_package_manager() { + unprep_package_manager() { echo "Nothing to unprepare." >$PackageManagerOutputDevice } - function prep_package_manager() { + prep_package_manager() { echo "Nothing to prepare." >$PackageManagerOutputDevice } fi