From 1acbfc6c66af30d1717036a50843a494d252e726 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 27 Nov 2021 18:41:44 +0100 Subject: [PATCH] Fix check that hotspot1 is up in multissid context --- conf/ynh-hotspot | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/conf/ynh-hotspot b/conf/ynh-hotspot index 1873e55..546d283 100644 --- a/conf/ynh-hotspot +++ b/conf/ynh-hotspot @@ -411,16 +411,20 @@ start) sleep 1 - i=0 - while ! ip link show dev "${new_gateway_interface}" &>/dev/null; do - sleep 1 - if [ ${i} -gt 20 ]; then - echo "Failed to see hotspot interface showing up in 'ip a'" - stop_hostapd - exit 1 - fi - i=$(($i + 1)) - done + # On single SSID, the hotspot interface will be wlan0 (or similar) + # in multissid, we additionally want to make sure that at least hotspot1 started + if [ "${multissid}" -gt 1 ]; then + i=0 + while ! ip link show dev "hotspot1" &>/dev/null; do + sleep 1 + if [ ${i} -gt 20 ]; then + echo "Failed to see hotspot interface showing up in 'ip a'" + stop_hostapd + exit 1 + fi + i=$(($i + 1)) + done + fi fi # For each registred ssid