mirror of
https://github.com/evilsocket/pwnagotchi.git
synced 2026-01-23 02:24:15 +00:00
new: macos connection share script now autodetects the usb interface and uses en0 as default upstream (closes #597)
This commit is contained in:
parent
a7e37115d9
commit
ab63ecccd7
1 changed files with 15 additions and 4 deletions
|
|
@ -1,9 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# name of the ethernet gadget interface on the host
|
||||
USB_IFACE=${1:-en8}
|
||||
# host interface to use for upstream connection
|
||||
UPSTREAM_IFACE=${2:-en7}
|
||||
UPSTREAM_IFACE=${1:-en0}
|
||||
USB_IFACE=''
|
||||
USB_IP=${2:-10.0.0.1}
|
||||
|
||||
for i in $(ifconfig -lu); do
|
||||
if ifconfig $i | grep -q "${USB_IP}" ; then USB_IFACE=$i; fi;
|
||||
done
|
||||
|
||||
if [ -z "$USB_IFACE" ]
|
||||
then
|
||||
echo "can't find usb interface with ip $USB_IP"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "sharing connecting from upstream interface $UPSTREAM_IFACE to usb interface $USB_IFACE ..."
|
||||
|
||||
sysctl -w net.inet.ip.forwarding=1
|
||||
pfctl -e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue