From 2ee5209ea3849089f37fabeb6d018f8e1bf55610 Mon Sep 17 00:00:00 2001 From: Zakary Timson Date: Mon, 26 Oct 2026 17:12:36 -0400 Subject: [PATCH] Delete access-point.sh --- access-point.sh | 136 ------------------------------------------------ 1 file changed, 136 deletions(-) delete mode 100644 access-point.sh diff --git a/access-point.sh b/access-point.sh deleted file mode 100644 index 590f3da..0000000 --- a/access-point.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash - -# Configuration ======================================================================================================= -WLAN0_IFACE="wlan0" -DHCP_IP="10.10.10.1" -DHCP_START="10.10.10.100" -DHCP_END="10.10.10.250" - -SSID="$HOSTNAME" -PASSWORD="guesswhatitis" -# End of Configuration ================================================================================================ - -is_connected() { - [ -n "$(iwgetid -r 2>/dev/null)" ] -} - -is_ap_on() { - [ "$(systemctl is-active hostapd 2>/dev/null)" == "active" ] -} - -enable_ap() { - if is_ap_on; then return; fi - echo "[$(date '+%H:%M:%S')] Enabling AP: $SSID" - # Bring down wlan0 and reset it - ip link set $WLAN0_IFACE down 2>/dev/null || true - sleep 1 - ip link set $WLAN0_IFACE up 2>/dev/null || true - sleep 1 - # Assign static IP for AP - ip addr flush dev $WLAN0_IFACE 2>/dev/null || true - ip addr add "$DHCP_IP/24" dev $WLAN0_IFACE - # Configure hostapd - cat > /etc/hostapd/hostapd.conf </dev/null || true - systemctl start hostapd - # Configure dnsmasq for DHCP - cat > /etc/dnsmasq.conf </dev/null || true - systemctl restart dnsmasq 2>/dev/null || true - ip addr del "$DHCP_IP/24" dev $WLAN0_IFACE 2>/dev/null || true -} - -# Main loop -echo "AP Failover Service started" -while true; do - is_connected && disable_ap || enable_ap - sleep 30 -done -root@radio:/# ls -access-point.sh boot etc lib media opt root sbin sys usr -bin dev home lost+found mnt proc run srv tmp var -root@radio:/# cat access-point.sh -#!/bin/bash - -# Configuration ======================================================================================================= -WLAN0_IFACE="wlan0" -DHCP_IP="10.10.10.1" -DHCP_START="10.10.10.100" -DHCP_END="10.10.10.250" - -SSID="$HOSTNAME" -PASSWORD="guesswhatitis" -# End of Configuration ================================================================================================ - -is_connected() { - [ -n "$(iwgetid -r 2>/dev/null)" ] -} - -is_ap_on() { - [ "$(systemctl is-active hostapd 2>/dev/null)" == "active" ] -} - -enable_ap() { - if is_ap_on; then return; fi - echo "[$(date '+%H:%M:%S')] Enabling AP: $SSID" - # Bring down wlan0 and reset it - ip link set $WLAN0_IFACE down 2>/dev/null || true - sleep 1 - ip link set $WLAN0_IFACE up 2>/dev/null || true - sleep 1 - # Assign static IP for AP - ip addr flush dev $WLAN0_IFACE 2>/dev/null || true - ip addr add "$DHCP_IP/24" dev $WLAN0_IFACE - # Configure hostapd - cat > /etc/hostapd/hostapd.conf </dev/null || true - systemctl start hostapd - # Configure dnsmasq for DHCP - cat > /etc/dnsmasq.conf </dev/null || true - systemctl restart dnsmasq 2>/dev/null || true - ip addr del "$DHCP_IP/24" dev $WLAN0_IFACE 2>/dev/null || true -} - -# Main loop -echo "AP Failover Service started" -while true; do - is_connected && disable_ap || enable_ap - sleep 30 -done \ No newline at end of file