From 92a6278317d1962a73b67393056a1172061a4019 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Tue, 17 Oct 2023 17:06:05 +0200 Subject: [PATCH] v2.4.8 Signed-off-by: Jeroen Oudshoorn --- builder/data/etc/dhcpcd.conf | 56 ++++++++++++++++++++++++++++++++++++ builder/data/usr/bin/pwnlib | 7 +++-- builder/pwnagotchi.yml | 6 ---- pwnagotchi/_version.py | 2 +- 4 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 builder/data/etc/dhcpcd.conf diff --git a/builder/data/etc/dhcpcd.conf b/builder/data/etc/dhcpcd.conf new file mode 100644 index 00000000..deac8212 --- /dev/null +++ b/builder/data/etc/dhcpcd.conf @@ -0,0 +1,56 @@ +# A sample configuration for dhcpcd. +# See dhcpcd.conf(5) for details. + +# Allow users of this group to interact with dhcpcd via the control socket. +#controlgroup wheel + +# Inform the DHCP server of our hostname for DDNS. +hostname + +# Use the hardware address of the interface for the Client ID. +clientid +# or +# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361. +# Some non-RFC compliant DHCP servers do not reply with this set. +# In this case, comment out duid and enable clientid above. +#duid + +# Persist interface configuration when dhcpcd exits. +persistent + +# Rapid commit support. +# Safe to enable by default because it requires the equivalent option set +# on the server to actually work. +option rapid_commit + +# A list of options to request from the DHCP server. +option domain_name_servers, domain_name, domain_search, host_name +option classless_static_routes +# Respect the network MTU. This is applied to DHCP routes. +option interface_mtu + +# Most distributions have NTP support. +#option ntp_servers + +# A ServerID is required by RFC2131. +require dhcp_server_identifier + +# Generate SLAAC address using the Hardware Address of the interface +#slaac hwaddr +# OR generate Stable Private IPv6 Addresses based from the DUID +slaac private + +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !! DO NOT EDIT THESE LINES BELOW PLEASE !! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +# static IP configuration: +denyinterfaces wlan0 + +interface eth0 +static domain_name_servers=8.8.8.8 1.1.1.1 + +interface usb0 +static ip_address=10.0.0.2/24 +static routers=10.0.0.1 +static domain_name_servers=10.0.0.1 8.8.8.8 1.1.1.1 \ No newline at end of file diff --git a/builder/data/usr/bin/pwnlib b/builder/data/usr/bin/pwnlib index 7bda613c..adf1e978 100755 --- a/builder/data/usr/bin/pwnlib +++ b/builder/data/usr/bin/pwnlib @@ -2,6 +2,7 @@ # well ... it blinks the led blink_led() { + # shellcheck disable=SC2034 for i in $(seq 1 "$1"); do echo 0 >/sys/class/leds/led0/brightness sleep 0.3 @@ -55,7 +56,7 @@ stop_monitor_interface() { # returns 0 if the specificed network interface is up is_interface_up() { - if grep -qi 'up' /sys/class/net/$1/operstate; then + if grep -qi 'up' /sys/class/net/"$1"/operstate; then return 0 fi return 1 @@ -79,7 +80,7 @@ is_auto_mode() { # if usb0 is up, we're in MANU if is_interface_up usb0; then - return 1 + return 0 fi # if eth0 is up (for other boards), we're in MANU @@ -105,7 +106,7 @@ is_auto_mode_no_delete() { # if usb0 is up, we're in MANU if is_interface_up usb0; then - return 1 + return 0 fi # if eth0 is up (for other boards), we're in MANU diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index 2afe510b..222f87e1 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -530,12 +530,6 @@ path: /boot/ssh state: touch - - name: disable wlan0 in dhcpcd.conf - lineinfile: - dest: /etc/dhcpcd.conf - insertafter: EOF - line: "denyinterfaces wlan0" - - name: adjust /boot/config.txt lineinfile: dest: /boot/config.txt diff --git a/pwnagotchi/_version.py b/pwnagotchi/_version.py index 1ac93fa4..e91b5bf4 100644 --- a/pwnagotchi/_version.py +++ b/pwnagotchi/_version.py @@ -1 +1 @@ -__version__ = '2.4.7' +__version__ = '2.4.8'