mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 10:22:02 +00:00
renambled dns thing
This commit is contained in:
parent
3c73a0487b
commit
f2e2fa9c7f
1 changed files with 14 additions and 18 deletions
32
setup.sh
32
setup.sh
|
|
@ -121,12 +121,11 @@ echo "NTPD removed (if present). Chrony, NMTUI, and Adjtimex installed and confi
|
||||||
echo "📡 Installing and configuring WiFi hotspot and captive portal..."
|
echo "📡 Installing and configuring WiFi hotspot and captive portal..."
|
||||||
|
|
||||||
if [ "$PKG_MANAGER" == "apt" ]; then
|
if [ "$PKG_MANAGER" == "apt" ]; then
|
||||||
# Ensure dnsmasq is removed to prevent conflicts with nodogsplash's DHCP server.
|
# We will use dnsmasq for DHCP, as the compiled nodogsplash version may not support the internal DHCP server.
|
||||||
echo "Removing dnsmasq to prevent conflicts..."
|
# sudo apt-get remove --purge -y dnsmasq || true # This line is no longer needed.
|
||||||
sudo apt-get remove --purge -y dnsmasq || true
|
|
||||||
|
|
||||||
# Install dependencies for hotspot and for building nodogsplash. dnsmasq is no longer needed.
|
# Install dependencies for hotspot and for building nodogsplash.
|
||||||
sudo apt install -y hostapd git libmicrohttpd-dev libjson-c-dev iptables
|
sudo apt install -y hostapd dnsmasq git libmicrohttpd-dev libjson-c-dev iptables
|
||||||
|
|
||||||
# Force iptables-legacy for nodogsplash
|
# Force iptables-legacy for nodogsplash
|
||||||
echo "Setting iptables-legacy mode for nodogsplash..."
|
echo "Setting iptables-legacy mode for nodogsplash..."
|
||||||
|
|
@ -170,7 +169,7 @@ fi
|
||||||
# Stop services to configure
|
# Stop services to configure
|
||||||
# Ensure services exist before trying to stop them
|
# Ensure services exist before trying to stop them
|
||||||
sudo systemctl stop hostapd || true
|
sudo systemctl stop hostapd || true
|
||||||
# sudo systemctl stop dnsmasq || true # dnsmasq is no longer used
|
sudo systemctl stop dnsmasq || true
|
||||||
if command -v nodogsplash &> /dev/null; then
|
if command -v nodogsplash &> /dev/null; then
|
||||||
sudo systemctl stop nodogsplash || true
|
sudo systemctl stop nodogsplash || true
|
||||||
fi
|
fi
|
||||||
|
|
@ -204,25 +203,21 @@ sudo nmcli c modify "$CON_NAME" 802-11-wireless-security.key-mgmt wpa-psk
|
||||||
sudo nmcli c modify "$CON_NAME" 802-11-wireless-security.psk "harry-ron-hermione"
|
sudo nmcli c modify "$CON_NAME" 802-11-wireless-security.psk "harry-ron-hermione"
|
||||||
sudo nmcli c modify "$CON_NAME" ipv4.method manual ipv4.addresses 10.0.252.1/24
|
sudo nmcli c modify "$CON_NAME" ipv4.method manual ipv4.addresses 10.0.252.1/24
|
||||||
|
|
||||||
# dnsmasq is no longer used. nodogsplash will handle DHCP.
|
# Configure dnsmasq for DHCP
|
||||||
# echo "Configuring dnsmasq..."
|
echo "Configuring dnsmasq..."
|
||||||
# sudo tee /etc/dnsmasq.conf > /dev/null <<EOF
|
sudo tee /etc/dnsmasq.conf > /dev/null <<EOF
|
||||||
# interface=wlan0
|
interface=wlan0
|
||||||
# dhcp-range=10.0.252.10,10.0.252.50,255.255.255.0,24h
|
dhcp-range=10.0.252.10,10.0.252.50,255.255.255.0,24h
|
||||||
# address=/#/10.0.252.1
|
address=/#/10.0.252.1
|
||||||
# EOF
|
EOF
|
||||||
|
|
||||||
# Configure nodogsplash for captive portal and DHCP
|
# Configure nodogsplash for captive portal
|
||||||
echo "Configuring nodogsplash..."
|
echo "Configuring nodogsplash..."
|
||||||
sudo tee /etc/nodogsplash/nodogsplash.conf > /dev/null <<EOF
|
sudo tee /etc/nodogsplash/nodogsplash.conf > /dev/null <<EOF
|
||||||
GatewayInterface wlan0
|
GatewayInterface wlan0
|
||||||
GatewayAddress 10.0.252.1
|
GatewayAddress 10.0.252.1
|
||||||
MaxClients 250
|
MaxClients 250
|
||||||
AuthIdleTimeout 480
|
AuthIdleTimeout 480
|
||||||
# Enable DHCP server in nodogsplash
|
|
||||||
DHCPInterface wlan0
|
|
||||||
DHCPStartAddress 10.0.252.10
|
|
||||||
DHCPEndAddress 10.0.252.50
|
|
||||||
FirewallRuleSet preauthenticated-users {
|
FirewallRuleSet preauthenticated-users {
|
||||||
FirewallRule allow tcp port 80
|
FirewallRule allow tcp port 80
|
||||||
FirewallRule allow tcp port 53
|
FirewallRule allow tcp port 53
|
||||||
|
|
@ -253,6 +248,7 @@ done
|
||||||
# Check for the IP address before starting nodogsplash
|
# Check for the IP address before starting nodogsplash
|
||||||
if [ "$IP_CHECK" == "10.0.252.1" ]; then
|
if [ "$IP_CHECK" == "10.0.252.1" ]; then
|
||||||
echo "✅ wlan0 configured with IP $IP_CHECK."
|
echo "✅ wlan0 configured with IP $IP_CHECK."
|
||||||
|
sudo systemctl restart dnsmasq
|
||||||
if command -v nodogsplash &> /dev/null; then
|
if command -v nodogsplash &> /dev/null; then
|
||||||
echo "Attempting to start nodogsplash service..."
|
echo "Attempting to start nodogsplash service..."
|
||||||
if ! sudo systemctl restart nodogsplash; then
|
if ! sudo systemctl restart nodogsplash; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue