Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
fixed script
Browse files Browse the repository at this point in the history
new instructions
new launcher
arch-linux launcher script
start script
token.txt file
does nothing atm
does nothing atm
  • Loading branch information
mickoissicko committed Jan 25, 2024
1 parent bfc3f08 commit 20a5689
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 4 deletions.
5 changes: 1 addition & 4 deletions archlinux/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ makepkg -si
cd script/
git clone https://aur.archlinux.org/mcrcon.git
cd mcrcon
makepkg -si

cd ..
sudo python ussr-ssl.py
makepkg -si
3 changes: 3 additions & 0 deletions instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
|| Installing it is super simple now!
|| Just read the docs @ mick.gdn/wiki/ussr.html
|| Only change the paths, and when you are done, run the launcher.py file! >:)
37 changes: 37 additions & 0 deletions launcher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# !launcher.py

import os

def setup_dependencies():
choice = input("Do you have the dependencies set up already? [y/n] ")
if choice.lower() == 'n':
os.chdir('archlinux/')
os.system('chmod +x install.sh')
os.system('./install.sh')
os.chdir('..')

def ussr_for_arch():
os.system('python setup/arch.py')

def ussr_for_win():
os.system('python setup/win.py')

def main_menu():
print("[1] Dependency setup")
print("[2] USSR for Arch")
print("[3] USSR for Windows")
print("\nChoice: ")

if __name__ == "__main__":
while True:
main_menu()
choice = input()

if choice == '1':
setup_dependencies()
elif choice == '2':
ussr_for_arch()
elif choice == '3':
ussr_for_win()
else:
print("Invalid choice. Please choose again.")
59 changes: 59 additions & 0 deletions setup/arch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# setup/arch.py

import os
import webbrowser

def main_menu():
print("[1] Launch USSR")
print("[2] Use Ngrok")

def launch_ussr():
os.chdir('setup/')

if os.path.exists("token.txt"):
with open("token.txt", "r") as file:
autk = file.read().strip()
print("Did you place the wrong copy-paste of the authentication token? [y/n]")
wrong_token = input("Your answer: ").lower()

if wrong_token == "y":
os.remove("token.txt")
print("Token deleted. Please enter your Ngrok authentication token again.")
webbrowser.open("https://dashboard.ngrok.com/get-started/your-authtoken")
autk = input("Your NGROK token: ")

with open("token.txt", "w") as file:
file.write(autk)
elif wrong_token == "n":
pass
else:
print("Invalid input. Assuming 'n'. Proceeding...")
else:
print("Enter your Ngrok authentication token:")
webbrowser.open("https://dashboard.ngrok.com/get-started/your-authtoken")
autk = input("Your NGROK token: ")

with open("token.txt", "w") as file:
file.write(autk)

os.system(f"ngrok config add-authtoken {autk}")

print("Starting the .sh script...")
os.system("bash start.sh")


if __name__ == "__main__":

while True:
main_menu()
choice = input("Enter your choice: ")

if choice == "1":
launch_ussr()
break
elif choice == "2":
print("Ngrok functionality not implemented yet.")
break
else:
print("Invalid choice. Please enter 1 or 2.")

7 changes: 7 additions & 0 deletions setup/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# !/bin/bash

cd ..
cd archlinux
cd server-arch

sudo python ussr-ssl.py
Empty file added setup/token.txt
Empty file.
1 change: 1 addition & 0 deletions setup/win.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# setup/win.py
Empty file added windows/run.bat
Empty file.

0 comments on commit 20a5689

Please sign in to comment.