Skip to content

Commit 0808ce5

Browse files
authored
Merge pull request #921 from pgrenaud/fix-macos-support
Fix macos support
2 parents 61ef927 + 88f514c commit 0808ce5

File tree

2 files changed

+31
-34
lines changed

2 files changed

+31
-34
lines changed

install.sh

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,6 @@ double_check=false
1919

2020
# ARM Detection
2121
ARCH=$(uname -m)
22-
case "$ARCH" in
23-
amd64 | x86_64)
24-
IS_ARM="False"
25-
;;
26-
arm64 | armv6l | aarch64)
27-
IS_ARM="True"
28-
if [[ $ARCH == "arm64" ]]; then
29-
RPI_4="True"
30-
RPI_3="False"
31-
else
32-
RPI_4="False"
33-
RPI_3="True"
34-
fi
35-
;;
36-
*)
37-
IS_ARM="False"
38-
;;
39-
esac
4022

4123
# macOS Detection
4224
IS_MAC=$([[ $OSTYPE == "darwin"* ]] && echo "True" || echo "False")
@@ -344,28 +326,31 @@ function install_golang_version() {
344326

345327
case "$ARCH" in
346328
arm64 | aarch64)
347-
if [[ $RPI_4 == "True" ]]; then
329+
if [[ $IS_MAC == "True" ]]; then
330+
wget "https://dl.google.com/go/${version}.darwin-arm64.tar.gz" -O "/tmp/${version}.darwin-arm64.tar.gz" &>/dev/null
331+
"$SUDO" tar -C /usr/local -xzf "/tmp/${version}.darwin-arm64.tar.gz" &>/dev/null
332+
else
348333
wget "https://dl.google.com/go/${version}.linux-arm64.tar.gz" -O "/tmp/${version}.linux-arm64.tar.gz" &>/dev/null
349334
"$SUDO" tar -C /usr/local -xzf "/tmp/${version}.linux-arm64.tar.gz" &>/dev/null
350-
elif [[ $RPI_3 == "True" ]]; then
351-
wget "https://dl.google.com/go/${version}.linux-armv6l.tar.gz" -O "/tmp/${version}.linux-armv6l.tar.gz" &>/dev/null
352-
"$SUDO" tar -C /usr/local -xzf "/tmp/${version}.linux-armv6l.tar.gz" &>/dev/null
353335
fi
354336
;;
355-
*)
337+
armv6l | armv7l)
338+
wget "https://dl.google.com/go/${version}.linux-armv6l.tar.gz" -O "/tmp/${version}.linux-armv6l.tar.gz" &>/dev/null
339+
"$SUDO" tar -C /usr/local -xzf "/tmp/${version}.linux-armv6l.tar.gz" &>/dev/null
340+
;;
341+
amd64 | x86_64)
356342
if [[ $IS_MAC == "True" ]]; then
357-
if [[ $IS_ARM == "True" ]]; then
358-
wget "https://dl.google.com/go/${version}.darwin-arm64.tar.gz" -O "/tmp/${version}.darwin-arm64.tar.gz" &>/dev/null
359-
"$SUDO" tar -C /usr/local -xzf "/tmp/${version}.darwin-arm64.tar.gz" &>/dev/null
360-
else
361-
wget "https://dl.google.com/go/${version}.darwin-amd64.tar.gz" -O "/tmp/${version}.darwin-amd64.tar.gz" &>/dev/null
362-
"$SUDO" tar -C /usr/local -xzf "/tmp/${version}.darwin-amd64.tar.gz" &>/dev/null
363-
fi
343+
wget "https://dl.google.com/go/${version}.darwin-amd64.tar.gz" -O "/tmp/${version}.darwin-amd64.tar.gz" &>/dev/null
344+
"$SUDO" tar -C /usr/local -xzf "/tmp/${version}.darwin-amd64.tar.gz" &>/dev/null
364345
else
365346
wget "https://dl.google.com/go/${version}.linux-amd64.tar.gz" -O "/tmp/${version}.linux-amd64.tar.gz" &>/dev/null
366347
"$SUDO" tar -C /usr/local -xzf "/tmp/${version}.linux-amd64.tar.gz" &>/dev/null
367348
fi
368349
;;
350+
*)
351+
echo -e "${bred}[!] Unsupported architecture. Please install go manually.${reset}"
352+
exit 1
353+
;;
369354
esac
370355

371356
"$SUDO" ln -sf /usr/local/go/bin/go /usr/local/bin/ 2>/dev/null
@@ -440,8 +425,7 @@ function install_brew() {
440425
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
441426
fi
442427
brew update &>/dev/null
443-
brew install --cask chromium &>/dev/null
444-
brew install bash coreutils python massdns jq gcc cmake ruby git curl libpcap-dev wget zip python3-dev pipx pv dnsutils whois libssl-dev libffi-dev libxml2-dev libxslt-dev zlib libnss3 atk bridge2.0 cups xkbcommon xcomposite xdamage xrandr gbm pangocairo alsa libxml2-utils &>/dev/null
428+
brew install --formula bash coreutils gnu-getopt python pipx massdns jq gcc cmake ruby git curl wget zip pv bind whois nmap jq lynx medusa &>/dev/null
445429
brew install rustup &>/dev/null
446430
rustup-init -y &>/dev/null
447431
cargo install ripgen &>/dev/null

reconftw.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6042,8 +6042,21 @@ function help() {
60426042

60436043
# macOS PATH initialization, thanks @0xtavian <3
60446044
if [[ $OSTYPE == "darwin"* ]]; then
6045-
PATH="/usr/local/opt/gnu-getopt/bin:$PATH"
6046-
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
6045+
if ! command -v brew &> /dev/null; then
6046+
printf "\n%bBrew is not installed or not in the PATH.%b\n\n" "$bred" "$reset"
6047+
exit 1
6048+
fi
6049+
if [[ ! -x "$(brew --prefix gnu-getopt)/bin/getopt" ]]; then
6050+
printf "\n%bBrew formula gnu-getopt is not installed.%b\n\n" "$bred" "$reset"
6051+
exit 1
6052+
fi
6053+
if [[ ! -d "$(brew --prefix coreutils)/libexec/gnubin" ]]; then
6054+
printf "\n%bBrew formula coreutils is not installed.%b\n\n" "$bred" "$reset"
6055+
exit 1
6056+
fi
6057+
# Prefix is different depending on Intel vs Apple Silicon
6058+
PATH="$(brew --prefix gnu-getopt)/bin:$PATH"
6059+
PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
60476060
fi
60486061

60496062
PROGARGS=$(getopt -o 'd:m:l:x:i:o:f:q:c:z:rspanwvh::' --long 'domain:,list:,recon,subdomains,passive,all,web,osint,zen,deep,help,vps,check-tools' -n 'reconFTW' -- "$@")

0 commit comments

Comments
 (0)