mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-09 18:18:11 -07:00
WIFI changes to support moxee. May need to rebase as delivering refactoring under other PR.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#!/bin/sh
|
||||
# Pushes all client-mode files to the Orbic device via ADB.
|
||||
# Dev tool: pushes WiFi client-mode files to a device via ADB.
|
||||
# For production installs, use the installer instead: ./installer moxee --admin-password X
|
||||
#
|
||||
# Usage: ./setup-device.sh [orbic|moxee]
|
||||
# If no device specified, auto-detects via ADB uid (root=Moxee, shell=Orbic).
|
||||
# Run from the rayhunter repo root.
|
||||
set -e
|
||||
|
||||
@@ -11,14 +15,38 @@ if ! adb devices | grep -q device$; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Pushing scripts..."
|
||||
adb shell "mkdir -p /data/rayhunter/scripts /data/rayhunter/bin"
|
||||
adb push "$SCRIPT_DIR/wifi-client.sh" /data/rayhunter/scripts/wifi-client.sh
|
||||
DEVICE="$1"
|
||||
if [ -z "$DEVICE" ]; then
|
||||
ADB_UID=$(adb shell id -u | tr -d '\r')
|
||||
if [ "$ADB_UID" = "0" ]; then
|
||||
DEVICE="moxee"
|
||||
else
|
||||
DEVICE="orbic"
|
||||
fi
|
||||
echo "Auto-detected device: $DEVICE (uid=$ADB_UID)"
|
||||
fi
|
||||
|
||||
case "$DEVICE" in
|
||||
moxee)
|
||||
DEST="/cache/rayhunter"
|
||||
;;
|
||||
orbic)
|
||||
DEST="/data/rayhunter"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown device: $DEVICE (expected 'orbic' or 'moxee')" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Pushing scripts to $DEST/scripts/..."
|
||||
adb shell "mkdir -p $DEST/scripts $DEST/bin"
|
||||
adb push "$SCRIPT_DIR/wifi-client.sh" "$DEST/scripts/wifi-client.sh"
|
||||
|
||||
if [ -f "$WPA_DIR/wpa_supplicant" ]; then
|
||||
echo "Pushing wpa_supplicant binaries..."
|
||||
adb push "$WPA_DIR/wpa_supplicant" /data/rayhunter/bin/wpa_supplicant
|
||||
adb push "$WPA_DIR/wpa_cli" /data/rayhunter/bin/wpa_cli
|
||||
echo "Pushing wpa_supplicant binaries to $DEST/bin/..."
|
||||
adb push "$WPA_DIR/wpa_supplicant" "$DEST/bin/wpa_supplicant"
|
||||
adb push "$WPA_DIR/wpa_cli" "$DEST/bin/wpa_cli"
|
||||
else
|
||||
echo "wpa_supplicant binaries not found at $WPA_DIR"
|
||||
echo "Build them first: see tools/build-wpa-supplicant/Dockerfile"
|
||||
@@ -26,5 +54,5 @@ else
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Files pushed. Set WiFi credentials via the web UI or installer,"
|
||||
echo "Files pushed to $DEST. Set WiFi credentials via the web UI or installer,"
|
||||
echo "then reboot. WiFi client starts automatically on boot."
|
||||
|
||||
Reference in New Issue
Block a user