Skip to content

Commit

Permalink
updated the UP mode check for interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Nov 14, 2024
1 parent 7776a60 commit c261562
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docker/go-fula/go-fula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,14 @@ fi
for interface in $interfaces; do
log "Checking wireless interface: $interface"
while : ; do
# Get the current state of the interface
state=$(ip link show "$interface" | awk '/state UP/ {print $9}')

# Check if the interface is in the 'UP' state
if [ "$state" = "UP" ]; then
log "Interface $interface is up and ready."
# Check if the interface exists and is administratively up
if ip link show "$interface" | grep -q "UP" ; then
log "Interface $interface is administratively up and ready."
break
else
log "Waiting for interface $interface to be ready..."
# Try to bring the interface up
ip link set "$interface" up 2>/dev/null
sleep 1
fi
done
Expand Down

0 comments on commit c261562

Please sign in to comment.