mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 10:22:02 +00:00
force dns and dhcp
This commit is contained in:
parent
320174fe53
commit
604d118d25
1 changed files with 19 additions and 1 deletions
20
setup.sh
20
setup.sh
|
|
@ -355,6 +355,12 @@ EOF
|
||||||
|
|
||||||
# Restart services in the correct order and add delays to prevent race conditions
|
# Restart services in the correct order and add delays to prevent race conditions
|
||||||
echo "Restarting services..."
|
echo "Restarting services..."
|
||||||
|
|
||||||
|
# Stop and disable systemd-resolved to prevent any DNS/DHCP conflicts
|
||||||
|
echo "Disabling systemd-resolved to ensure dnsmasq has full control..."
|
||||||
|
sudo systemctl stop systemd-resolved || true
|
||||||
|
sudo systemctl disable systemd-resolved || true
|
||||||
|
|
||||||
# Restart dhcpcd to apply the static IP
|
# Restart dhcpcd to apply the static IP
|
||||||
sudo systemctl restart dhcpcd
|
sudo systemctl restart dhcpcd
|
||||||
# Restart hostapd to create the access point
|
# Restart hostapd to create the access point
|
||||||
|
|
@ -377,7 +383,19 @@ 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
|
|
||||||
|
# Add a small delay to ensure the interface is fully ready for dnsmasq
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
echo "Attempting to start dnsmasq service..."
|
||||||
|
if ! sudo systemctl restart dnsmasq; then
|
||||||
|
echo "❌ dnsmasq service failed to start. Displaying logs..."
|
||||||
|
sleep 2
|
||||||
|
sudo journalctl -u dnsmasq.service --no-pager -n 50
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✅ dnsmasq service started successfully."
|
||||||
|
|
||||||
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