Spaces:
Running
Running
File size: 821 Bytes
ec50620 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/bin/bash
# Get the IP address
IP=$(ipconfig getifaddr en0)
if [ -z "$IP" ]; then
# Try wifi interface if en0 doesn't work
IP=$(ipconfig getifaddr en1)
fi
# Function to display the message at the bottom
display_ip() {
while true; do
# Move to bottom of screen
tput cup $(($(tput lines)-4)) 0
# Clear 4 lines
tput el; echo
tput el; echo -e "\033[33m🌐 Network Access URL for iOS:"
tput el; echo -e "https://$IP:3000"
tput el; echo -e "==========================================\033[0m"
sleep 1
done
}
# Start the display in background
display_ip &
DISPLAY_PID=$!
# Cleanup on script exit
trap 'kill $DISPLAY_PID; tput cnorm; clear' EXIT
# Start the React app with HTTPS and network access
HTTPS=true HOST=0.0.0.0 react-scripts start |