From 357a7b6d1c0473eacd6aa0fe00ea5356507682fe Mon Sep 17 00:00:00 2001 From: Vincent Rose Date: Sat, 21 Aug 2021 10:34:54 -0700 Subject: [PATCH] correct the issue wehre running the install script from a different directory would break the execution (#204) --- setup/install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/install.sh b/setup/install.sh index 6b191b312..85f07787f 100755 --- a/setup/install.sh +++ b/setup/install.sh @@ -17,8 +17,9 @@ function install_powershell() { elif [ $OS_NAME == "KALI" ]; then apt update && apt -y install powershell fi + mkdir -p /usr/local/share/powershell/Modules - cp -r ./empire/server/powershell/Invoke-Obfuscation /usr/local/share/powershell/Modules + cp -r "$PARENT_PATH"/empire/server/powershell/Invoke-Obfuscation /usr/local/share/powershell/Modules rm -f packages-microsoft-prod.deb* } @@ -54,6 +55,8 @@ apt-get update && apt-get install -y wget sudo sudo -v +# https://stackoverflow.com/questions/24112727/relative-paths-based-on-file-location-instead-of-current-working-directory +PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; cd .. ; pwd -P ) OS_NAME= VERSION_ID= if grep "10.*" /etc/debian_version 2>/dev/null; then