Updated: one-click installation bash script that includes the output information after the container starts, such as the admin web management URL and default login credentials

This commit is contained in:
Tola Leng
2025-06-06 17:42:18 +08:00
parent 5a5772f9a4
commit 11ddc77e32
+16 -14
View File
@@ -2,14 +2,14 @@
set -e
REPO_URL="https://github.com/operacle/checkcle.git"
CLONE_DIR="/opt/checkcle"
DATA_DIR="/opt/pb_data"
PORT=8090
COMPOSE_FILE="/opt/docker-compose.yml"
RAW_URL="https://raw.githubusercontent.com/operacle/checkcle/main/docker-compose.yml"
echo "🚀 Installing Checkcle from $REPO_URL"
echo "🚀 Installing Checkcle using Docker Compose"
# Step 1: Check if port 8090 is already in use
# Step 1: Check if port is already in use
if lsof -i :"$PORT" &>/dev/null; then
echo "❗ ERROR: Port $PORT is already in use. Please free the port or change the Docker Compose configuration."
exit 1
@@ -27,13 +27,12 @@ if ! docker compose version &> /dev/null; then
exit 1
fi
# Step 4: Clone the repository
if [ -d "$CLONE_DIR" ]; then
echo "📁 Directory $CLONE_DIR already exists. Pulling latest changes..."
git -C "$CLONE_DIR" pull
# Step 4: Download docker-compose.yml if not exists
if [ ! -f "$COMPOSE_FILE" ]; then
echo "📥 Downloading docker-compose.yml to $COMPOSE_FILE..."
curl -fsSL "$RAW_URL" -o "$COMPOSE_FILE"
else
echo "📥 Cloning repo to $CLONE_DIR"
git clone "$REPO_URL" "$CLONE_DIR"
echo "✅ docker-compose.yml already exists at $COMPOSE_FILE"
fi
# Step 5: Create data volume directory if it doesnt exist
@@ -44,16 +43,19 @@ if [ ! -d "$DATA_DIR" ]; then
fi
# Step 6: Start the service
cd "$CLONE_DIR"
cd /opt
echo "📦 Starting Checkcle service with Docker Compose..."
docker compose up -d
docker compose -f "$COMPOSE_FILE" up -d
# Step 7: Show success output
# Step 7: Detect host IP address
HOST_IP=$(hostname -I | awk '{print $1}')
# Step 8: Show success output
echo ""
echo "✅ Checkcle has been successfully installed and started."
echo ""
echo "🛠️ Admin Web Management"
echo "🔗 Default URL: http://0.0.0.0:$PORT"
echo "🔗 Default URL: http://$HOST_IP:$PORT"
echo "👤 User: admin@example.com"
echo "🔑 Passwd: Admin123456"
echo ""