mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
lets reload pf.conf, and check for root just-in-case
This commit is contained in:
@ -3,11 +3,16 @@
|
|||||||
USB_IFACE=$(ifconfig urndis0 | grep urndis0 | awk '{print $1}' | tr -d ':')
|
USB_IFACE=$(ifconfig urndis0 | grep urndis0 | awk '{print $1}' | tr -d ':')
|
||||||
USB_IP=${2:-10.0.0.1}
|
USB_IP=${2:-10.0.0.1}
|
||||||
|
|
||||||
|
if test $(whoami) != root; then
|
||||||
|
doas "$0" "$@"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${USB_IFACE}" == "urndis0" ]; then
|
if [ "${USB_IFACE}" == "urndis0" ]; then
|
||||||
ifconfig ${USB_IFACE} ${USB_IP}
|
ifconfig ${USB_IFACE} ${USB_IP}
|
||||||
sysctl -w net.inet.ip.forwarding=1
|
sysctl -w net.inet.ip.forwarding=1
|
||||||
pfctl -e
|
|
||||||
echo "match out on egress inet from ${USB_IFACE}:network to any nat-to (egress:0)" | pfctl -f -
|
echo "match out on egress inet from ${USB_IFACE}:network to any nat-to (egress:0)" | pfctl -f -
|
||||||
|
pfctl -f /etc/pf.conf
|
||||||
echo "sharing connecting from upstream interface to usb interface ${USB_IFACE} ..."
|
echo "sharing connecting from upstream interface to usb interface ${USB_IFACE} ..."
|
||||||
else
|
else
|
||||||
echo "can't find usb interface with ip ${USB_IFACE}"
|
echo "can't find usb interface with ip ${USB_IFACE}"
|
||||||
|
Reference in New Issue
Block a user