From 803298c69672a0a7813cb6687cacfd3d89059f26 Mon Sep 17 00:00:00 2001 From: InfiniteCod3 <91837651+InfiniteCod3@users.noreply.github.com> Date: Sat, 17 Dec 2022 11:17:27 +0100 Subject: [PATCH 1/3] Update install.py --- dockerbot/install.py | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/dockerbot/install.py b/dockerbot/install.py index 4273734..53e1fa2 100644 --- a/dockerbot/install.py +++ b/dockerbot/install.py @@ -28,26 +28,24 @@ class bcolors: Choose carefully! """) -def getarch(): - try: - architecture = int(input("> ")) + while True: + try: + architecture = int(input("> ")) - if architecture == 1: - return architecture - elif architecture == 2: - return architecture - elif architecture == 3: - print("You can search on google how to get it :)") - elif architecture == 4: - print("Ask the developer for help :)") - else: + if architecture in (1, 2): + return architecture + elif architecture == 3: + print("You can search on google how to get it :)") + elif architecture == 4: + print("Ask the developer for help :)") + else: + print("Enter a correct value!") + except ValueError: print("Enter a correct value!") - except: - print("Enter a correct value!") -getarch() def install(): - if getarch() == 1: + architecture = getarch() + if architecture == 1: print(f"{bcolors.WARNING}Installing requirements{bcolors.ENDC}") os.system("apt install screenfetch git wondershaper docker.io -y") print(f"{bcolors.WARNING}70% Done{bcolors.ENDC}") @@ -55,7 +53,7 @@ def install(): os.system("cd vpsbot/dockerbot") os.system("wget -O imagesamd64.tar.gz 'https://drive.google.com/uc?id=1iUUNLS4hhSk6vCXMwjR09jCOFAblK7as&export=download&confirm=t&uuid=6aa2ceab-5731-4e33-ab08-f054aedafe3e' && docker load < imagesamd64.tar") print(f"{bcolors.WARNING}100% Done{bcolors.ENDC}") - if getarch() == 2: + if architecture == 2: print(f"{bcolors.WARNING}Installing requirements{bcolors.ENDC}") os.system("apt install screenfetch git wondershaper docker.io -y") print(f"{bcolors.WARNING}70% Done{bcolors.ENDC}") From 86ca39403256af83b6bac3617f98232e3cab540c Mon Sep 17 00:00:00 2001 From: InfiniteCod3 <91837651+InfiniteCod3@users.noreply.github.com> Date: Sat, 17 Dec 2022 11:19:15 +0100 Subject: [PATCH 2/3] Update install.py --- dockerbot/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerbot/install.py b/dockerbot/install.py index 53e1fa2..cac5496 100644 --- a/dockerbot/install.py +++ b/dockerbot/install.py @@ -27,7 +27,7 @@ class bcolors: Choose carefully! """) - +def getarch(): while True: try: architecture = int(input("> ")) From 0decd0a1273f1e7ac9c5662f877194b75c97c527 Mon Sep 17 00:00:00 2001 From: InfiniteCod3 <91837651+InfiniteCod3@users.noreply.github.com> Date: Sat, 17 Dec 2022 11:22:18 +0100 Subject: [PATCH 3/3] Update install.py --- dockerbot/install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerbot/install.py b/dockerbot/install.py index cac5496..85f502d 100644 --- a/dockerbot/install.py +++ b/dockerbot/install.py @@ -51,7 +51,7 @@ def install(): print(f"{bcolors.WARNING}70% Done{bcolors.ENDC}") os.system("git clone https://github.com/dxomg/vpsbot") os.system("cd vpsbot/dockerbot") - os.system("wget -O imagesamd64.tar.gz 'https://drive.google.com/uc?id=1iUUNLS4hhSk6vCXMwjR09jCOFAblK7as&export=download&confirm=t&uuid=6aa2ceab-5731-4e33-ab08-f054aedafe3e' && docker load < imagesamd64.tar") + os.system("wget -O imagesamd64.tar.gz 'https://drive.google.com/uc?id=1iUUNLS4hhSk6vCXMwjR09jCOFAblK7as&export=download&confirm=t&uuid=6aa2ceab-5731-4e33-ab08-f054aedafe3e' && docker load < imagesamd64.tar.gz") print(f"{bcolors.WARNING}100% Done{bcolors.ENDC}") if architecture == 2: print(f"{bcolors.WARNING}Installing requirements{bcolors.ENDC}") @@ -59,7 +59,7 @@ def install(): print(f"{bcolors.WARNING}70% Done{bcolors.ENDC}") os.system("git clone https://github.com/dxomg/vpsbot") os.system("cd vpsbot/dockerbot") - os.system("wget -O imagesamd64.tar.gz 'https://drive.google.com/uc?id=1lGrbGAnDBbGpUH63X_zq2Bxy0EeOXNnY&export=download&confirm=t&uuid=90ee1fa3-806d-40c3-9cc1-d31adf586b17' && docker load < imagesarm64.tar") + os.system("wget -O imagesamd64.tar.gz 'https://drive.google.com/uc?id=1lGrbGAnDBbGpUH63X_zq2Bxy0EeOXNnY&export=download&confirm=t&uuid=90ee1fa3-806d-40c3-9cc1-d31adf586b17' && docker load < imagesarm64.tar.gz") print(f"{bcolors.OKGREEN}100% Done{bcolors.ENDC}") print(f""" {bcolors.WARNING}Install has been completed!, now go edit the config.cfg file to your needs