Browse Source

Update configure-linux

Standardized OS check
Mark Shust 1 năm trước cách đây
mục cha
commit
94f9b9901b
1 tập tin đã thay đổi với 3 bổ sung7 xóa
  1. 3 7
      compose/bin/configure-linux

+ 3 - 7
compose/bin/configure-linux

@@ -1,7 +1,8 @@
 #!/usr/bin/env bash
 
-# Check if the script is running on Linux
-if [[ "$OSTYPE" == "linux-gnu"* ]]; then
+if [ "$(uname)" == "Darwin" ]; then
+    echo "This script is designed for Linux and may not work properly on macOS."
+else
     # Get the IP address from the Docker container
     docker_ip=$(docker run --rm alpine ip route | awk 'NR==1 {print $3}')
 
@@ -20,11 +21,6 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
         sudo iptables -A INPUT -p tcp --dport 9003 -j ACCEPT
         echo "Port 9003 has been opened for xdebug."
     fi
-elif [[ "$OSTYPE" == "darwin"* ]]; then
-    echo "This script is designed for Linux and may not work properly on macOS."
-else
-    echo "Unsupported operating system."
 fi
 
 echo "Tasks completed successfully"
-