|
@@ -25,18 +25,22 @@ fi
|
|
|
REPO_NAME="v2ray-nginx-cloudflare"
|
|
REPO_NAME="v2ray-nginx-cloudflare"
|
|
|
REPO_URL="https://github.com/samrand96/v2ray-nginx-cloudflare.git"
|
|
REPO_URL="https://github.com/samrand96/v2ray-nginx-cloudflare.git"
|
|
|
|
|
|
|
|
-if [ -d "$REPO_NAME" ]; then
|
|
|
|
|
- echo "Repository $REPO_NAME already exists. Skipping cloning."
|
|
|
|
|
|
|
+# Check if the repository directory exists and is a Git repository
|
|
|
|
|
+if [ -d "$REPO_NAME/.git" ]; then
|
|
|
|
|
+ echo "Repository '$REPO_NAME' already exists and is a Git repository. Skipping cloning."
|
|
|
else
|
|
else
|
|
|
- if ! git clone "$REPO_URL"; then
|
|
|
|
|
|
|
+ echo "Cloning repository '$REPO_NAME'..."
|
|
|
|
|
+ if git clone "$REPO_URL"; then
|
|
|
|
|
+ echo "Repository cloned successfully."
|
|
|
|
|
+ else
|
|
|
echo "Failed to clone the repository. Exiting."
|
|
echo "Failed to clone the repository. Exiting."
|
|
|
exit 1
|
|
exit 1
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-# Navigate to the repository directory
|
|
|
|
|
cd "$REPO_NAME" || { echo "Failed to navigate to the repository directory. Exiting."; exit 1; }
|
|
cd "$REPO_NAME" || { echo "Failed to navigate to the repository directory. Exiting."; exit 1; }
|
|
|
|
|
|
|
|
|
|
+
|
|
|
# Generate random UUID
|
|
# Generate random UUID
|
|
|
read -p "Do you want to use a custom UUID? (Y/n): " CUSTOM_UUID
|
|
read -p "Do you want to use a custom UUID? (Y/n): " CUSTOM_UUID
|
|
|
if [[ "${CUSTOM_UUID:-Y}" =~ ^[Yy]$ ]]; then
|
|
if [[ "${CUSTOM_UUID:-Y}" =~ ^[Yy]$ ]]; then
|
|
@@ -63,7 +67,7 @@ if ! sed -i "s#YOUR_DOMAIN#$DOMAIN#g" ./docker-compose.yml || ! sed -i "s#YOUR_E
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# Compose the Docker setup
|
|
# Compose the Docker setup
|
|
|
-if ! docker-compose up -d; then
|
|
|
|
|
|
|
+if ! sudo docker-compose up -d; then
|
|
|
echo "Failed to start Docker containers. Exiting."
|
|
echo "Failed to start Docker containers. Exiting."
|
|
|
exit 1
|
|
exit 1
|
|
|
fi
|
|
fi
|
|
@@ -78,4 +82,4 @@ if [[ "${USE_CDN:-Y}" =~ ^[Yy]$ ]]; then
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-echo "Setup completed successfully."
|
|
|
|
|
|
|
+echo "Setup completed successfully."
|