From aca1b4056b9c6b94c801922be18881a5b70464a7 Mon Sep 17 00:00:00 2001 From: greenseeker Date: Sun, 18 Feb 2024 18:53:10 -0500 Subject: [PATCH] get version number from /etc/t2server/version and include in output --- usr/local/bin/t2help | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/usr/local/bin/t2help b/usr/local/bin/t2help index b5dcee2..b1f4fa0 100755 --- a/usr/local/bin/t2help +++ b/usr/local/bin/t2help @@ -1,10 +1,20 @@ #!/usr/bin/env -S python3 -B -from t2support import color +from t2support import color, release_file +from os.path import isfile + +# Get the version from the release file +if isfile(release_file): + with open(release_file, 'r') as rf: + version = rf.read().rstrip() +else: + version = None + +if version: print(f"{color.DC}t2server {version}") print(f"\n{color.DC}The follow commands can be used to manage your Tribes 2 server:") print(f"""\n{color.BW}systemctl t2server{color.DC}: The t2server service can be managed with the -standard Linux systemctl command.""") +standard Linux systemctl command. See 'man systemctl' for more info.""") print(f"""\n{color.BW}t2fixer{color.DC}: This command resets the owner and permissions on all files associated with t2server. It's recommended to run this command any time you make changes