mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-06 13:11:53 -07:00
Merge install scripts into a single, isntall.sh
This commit is contained in:
Vendored
-23
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
export SERIAL_PATH="./serial-ubuntu-latest/serial"
|
|
||||||
|
|
||||||
if [ ! -x "$SERIAL_PATH" ]; then
|
|
||||||
echo "The serial binary cannot be found at $SERIAL_PATH. If you are running this from the git tree please instead run it from the latest release bundle https://github.com/EFForg/rayhunter/releases"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v adb &> /dev/null; then
|
|
||||||
if [ ! -d ./platform-tools ] ; then
|
|
||||||
echo "adb not found, downloading local copy"
|
|
||||||
curl -O "https://dl.google.com/android/repository/platform-tools-latest-linux.zip"
|
|
||||||
unzip platform-tools-latest-linux.zip
|
|
||||||
fi
|
|
||||||
export ADB="./platform-tools/adb"
|
|
||||||
else
|
|
||||||
export ADB=`which adb`
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "$(dirname "$0")"/install-common.sh
|
|
||||||
install
|
|
||||||
Vendored
-22
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
export SERIAL_PATH="./serial-macos-latest/serial"
|
|
||||||
if [ ! -x "$SERIAL_PATH" ]; then
|
|
||||||
echo "The serial binary cannot be found at $SERIAL_PATH. If you are running this from the git tree please instead run it from the latest release bundle at https://github.com/EFForg/rayhunter/releases"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v adb &> /dev/null; then
|
|
||||||
if [ ! -d ./platform-tools ]; then
|
|
||||||
echo "adb not found, downloading local copy"
|
|
||||||
curl -O "https://dl.google.com/android/repository/platform-tools-latest-darwin.zip"
|
|
||||||
unzip platform-tools-latest-darwin.zip
|
|
||||||
fi
|
|
||||||
export ADB="./platform-tools/adb"
|
|
||||||
else
|
|
||||||
export ADB=`which adb`
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "$(dirname "$0")"/install-common.sh
|
|
||||||
install
|
|
||||||
+36
-14
@@ -1,18 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
install() {
|
set -e
|
||||||
if [[ -z "${SERIAL_PATH}" ]]; then
|
|
||||||
echo "\$SERIAL_PATH not set, did you run this from install-linux.sh or install-mac.sh?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [[ -z "${ADB}" ]]; then
|
|
||||||
echo "\$ADB not set, did you run this from install-linux.sh or install-mac.sh?"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
force_debug_mode
|
|
||||||
setup_rootshell
|
|
||||||
setup_rayhunter
|
|
||||||
test_rayhunter
|
|
||||||
}
|
|
||||||
|
|
||||||
force_debug_mode() {
|
force_debug_mode() {
|
||||||
echo "Using adb at $ADB"
|
echo "Using adb at $ADB"
|
||||||
@@ -108,3 +95,38 @@ test_rayhunter() {
|
|||||||
done
|
done
|
||||||
echo "timeout reached! failed to reach rayhunter url $URL, something went wrong :("
|
echo "timeout reached! failed to reach rayhunter url $URL, something went wrong :("
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##### ##### #####
|
||||||
|
##### Main #####
|
||||||
|
##### ##### #####
|
||||||
|
if [ `uname -s` = "Linux" ]; then
|
||||||
|
export SERIAL_PATH="./serial-ubuntu-latest/serial"
|
||||||
|
export PLATFORM_TOOLS="platform-tools-latest-linux.zip"
|
||||||
|
elif [ `uname -s` = "Darwin" ]; then
|
||||||
|
export SERIAL_PATH="./serial-macos-latest/serial"
|
||||||
|
export PLATFORM_TOOLS="platform-tools-latest-darwin.zip"
|
||||||
|
else
|
||||||
|
echo "This script only supports Linux or macOS"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "$SERIAL_PATH" ]; then
|
||||||
|
echo "The serial binary cannot be found at $SERIAL_PATH. If you are running this from the git tree please instead run it from the latest release bundle https://github.com/EFForg/rayhunter/releases"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v adb &> /dev/null; then
|
||||||
|
if [ ! -d ./platform-tools ] ; then
|
||||||
|
echo "adb not found, downloading local copy"
|
||||||
|
curl -O "https://dl.google.com/android/repository/${PLATFORM_TOOLS}"
|
||||||
|
unzip $PLATFORM_TOOLS
|
||||||
|
fi
|
||||||
|
export ADB="./platform-tools/adb"
|
||||||
|
else
|
||||||
|
export ADB=`which adb`
|
||||||
|
fi
|
||||||
|
|
||||||
|
force_debug_mode
|
||||||
|
setup_rootshell
|
||||||
|
setup_rayhunter
|
||||||
|
test_rayhunter
|
||||||
Reference in New Issue
Block a user