Files
feroxbuster/install-nix.sh

68 lines
1.8 KiB
Bash
Raw Permalink Normal View History

2020-10-25 07:15:07 -05:00
#!/usr/bin/env bash
BASE_URL=https://github.com/epi052/feroxbuster/releases/latest/download
MAC_ZIP=x86_64-macos-feroxbuster.zip
2021-04-14 17:37:26 +00:00
MAC_URL="$BASE_URL/$MAC_ZIP"
2020-10-25 07:15:07 -05:00
LIN32_ZIP=x86-linux-feroxbuster.zip
2021-04-14 17:37:26 +00:00
LIN32_URL="$BASE_URL/$LIN32_ZIP"
2020-10-25 07:15:07 -05:00
LIN64_ZIP=x86_64-linux-feroxbuster.zip
2021-04-14 17:37:26 +00:00
LIN64_URL="$BASE_URL/$LIN64_ZIP"
2020-10-25 07:15:07 -05:00
EMOJI_URL=https://gist.github.com/epi052/8196b550ea51d0907ad4b93751b1b57d/raw/6112c9f32ae07922983fdc549c54fd3fb9a38e4c/NotoColorEmoji.ttf
INSTALL_DIR="${1:-$(pwd)}"
echo "[+] Installing feroxbuster to ${INSTALL_DIR}!"
2020-10-25 07:15:07 -05:00
2021-04-14 19:35:24 +02:00
which unzip &>/dev/null
if [ "$?" != "0" ]; then
echo "[!] unzip not found, exiting. "
2021-04-14 17:37:28 +00:00
exit -1
2021-04-14 19:35:24 +02:00
fi
2020-10-25 07:15:07 -05:00
if [[ "$(uname)" == "Darwin" ]]; then
2021-04-14 17:37:28 +00:00
echo "[=] Found MacOS, downloading from $MAC_URL"
2020-10-25 07:15:07 -05:00
2021-04-14 17:37:28 +00:00
curl -sLO "$MAC_URL"
unzip -o "$MAC_ZIP" -d "${INSTALL_DIR}" >/dev/null
2021-04-14 17:37:28 +00:00
rm "$MAC_ZIP"
2020-10-25 07:15:07 -05:00
elif [[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then
2021-04-14 17:37:28 +00:00
if [[ $(getconf LONG_BIT) == 32 ]]; then
echo "[=] Found 32-bit Linux, downloading from $LIN32_URL"
curl -sLO "$LIN32_URL"
unzip -o "$LIN32_ZIP" -d "${INSTALL_DIR}" >/dev/null
2021-04-14 17:37:28 +00:00
rm "$LIN32_ZIP"
else
echo "[=] Found 64-bit Linux, downloading from $LIN64_URL"
curl -sLO "$LIN64_URL"
unzip -o "$LIN64_ZIP" -d "${INSTALL_DIR}" >/dev/null
2021-04-14 17:37:28 +00:00
rm "$LIN64_ZIP"
fi
if [[ "$(fc-list NotoColorEmoji | wc -l)" -gt 0 ]]; then
2021-04-14 17:37:28 +00:00
echo "[=] Found Noto Emoji Font, skipping install"
else
echo "[=] Installing Noto Emoji Font"
mkdir -p ~/.fonts
pushd ~/.fonts 2>&1 >/dev/null
curl -sLO "$EMOJI_URL"
fc-cache -f -v >/dev/null
popd 2>&1 >/dev/null
echo "[+] Noto Emoji Font installed"
fi
2020-10-25 07:15:07 -05:00
fi
chmod +x "${INSTALL_DIR}/feroxbuster"
2020-10-25 07:15:07 -05:00
echo "[+] Installed feroxbuster"
echo " [-] path: ${INSTALL_DIR}/feroxbuster"
echo " [-] version: $(${INSTALL_DIR}/feroxbuster -V | awk '{print $2}')"