From 6af82342fc10c11a7455dde761ca01aeb3d3504f Mon Sep 17 00:00:00 2001 From: Ben de Roo Date: Tue, 24 Feb 2026 16:35:22 +0100 Subject: [PATCH] Update install/script.sh --- install/script.sh | 56 ++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/install/script.sh b/install/script.sh index 5f17021..305a831 100644 --- a/install/script.sh +++ b/install/script.sh @@ -1,47 +1,39 @@ #!/bin/bash -DEFAULT_REPO="https://git.de-roo.org/ben/pychat.git" +BASE_URL="https://git.de-roo.org/ben/pychat/raw/branch/main" +INSTALL_DIR="install" + echo "Thanks for using PyChat!" -# Gebruik eerste argument als repo, anders default -REPO_URL="${1:-$DEFAULT_REPO}" - -# Gebruik tweede argument als directory naam, anders afleiden van repo -DIR_NAME="${2:-$(basename "$REPO_URL" .git)}" - -# Controleer of git beschikbaar is -if ! command -v git &> /dev/null; then - echo "Error: git is not installed." - exit 1 -fi - -# Controleer of python beschikbaar is +# python check if ! command -v python3 &> /dev/null; then echo "Error: python3 is not installed." exit 1 fi -# Check of directory al bestaat -if [ -d "$DIR_NAME" ]; then - echo "Directory '$DIR_NAME' already exists. Skipping clone." +# downloader check +if command -v curl &> /dev/null; then + DL="curl -L -o" +elif command -v wget &> /dev/null; then + DL="wget -O" else - git clone "$REPO_URL" "$DIR_NAME" || { echo "Git clone failed."; exit 1; } + echo "Error: curl or wget required." + exit 1 fi -echo -echo "Don't forget to change IP/port in client.py to connect to the correct server." -echo "Edit client using: nano $DIR_NAME/client.py" -echo +mkdir -p "$INSTALL_DIR" +cd "$INSTALL_DIR" || exit 1 -cd pychat +# bestanden downloaden +$DL server.py "$BASE_URL/server.py" +$DL client.py "$BASE_URL/client.py" +$DL clientBeta.py "$BASE_URL/clientBeta.py" +$DL clientWin.py "$BASE_URL/clientWin.py" +$DL passwd.json "$BASE_URL/passwd.json" +echo +echo "Don't forget to change IP/port in client.py." echo "Installation complete." -echo "Start the server with: cd pychat" -echo "python3 server.py" -echo -echo "Start the client with: cd pychat" -echo "python3 client.py" -echo -echo "there is also a beta test client, (not functional) with a better ui." -echo "start the beta client with: cd pychat" -echo "python3 clientBeta.py" \ No newline at end of file +echo "Start server: python3 server.py" +echo "Start client: python3 client.py" +echo "Start beta: python3 clientBeta.py" \ No newline at end of file