Docker Detection
This commit is contained in:
parent
46de27aca8
commit
cfd0b84872
@ -7,4 +7,4 @@ RUN pip3 install -r requirements.txt
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
#CMD [ "python3", "main.py"] #Uncomment to start with the Docker Container
|
CMD [ "python3", "main.py"] #Uncomment to start with the Docker Container
|
||||||
11
main.py
11
main.py
@ -100,16 +100,19 @@ def thread_main():
|
|||||||
thread_.start()
|
thread_.start()
|
||||||
|
|
||||||
if config.user_module == True:
|
if config.user_module == True:
|
||||||
thread_ = threading.Thread(target=user_module_init, args=(dbCert, None))
|
if utility.isRunningInDocker() == False:
|
||||||
threads.append(thread_)
|
config.user_module = False
|
||||||
thread_.start()
|
thread_ = threading.Thread(target=user_module_init, args=(dbCert, None))
|
||||||
|
threads.append(thread_)
|
||||||
|
thread_.start()
|
||||||
|
|
||||||
print("---Post Thread Creation Test---")
|
print("---Post Thread Creation Test---")
|
||||||
for t in threads:
|
for t in threads:
|
||||||
t.join()
|
t.join()
|
||||||
|
|
||||||
print("---Point of no return---")
|
print("---Point of no return---")
|
||||||
input()
|
if utility.isRunningInDocker() == False:
|
||||||
|
input()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,8 @@ from commands.command_base import AbstractCommand
|
|||||||
|
|
||||||
from cooldowns import Cooldown_Module
|
from cooldowns import Cooldown_Module
|
||||||
|
|
||||||
|
import utilities_script as utility
|
||||||
|
|
||||||
class User_Module():
|
class User_Module():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@ -19,6 +21,9 @@ class User_Module():
|
|||||||
def main(self):
|
def main(self):
|
||||||
print("\nWaiting on User input...\n")
|
print("\nWaiting on User input...\n")
|
||||||
inputLoop = True
|
inputLoop = True
|
||||||
|
if utility.isRunningInDocker() == False:
|
||||||
|
inputLoop = False
|
||||||
|
print("\nNo User's Input Allowed")
|
||||||
while inputLoop:
|
while inputLoop:
|
||||||
keyboardInput = input()
|
keyboardInput = input()
|
||||||
message = UserMessage()
|
message = UserMessage()
|
||||||
|
|||||||
@ -65,6 +65,12 @@ def contains_slur(input: str):
|
|||||||
print("<{ slur detected! }> ")
|
print("<{ slur detected! }> ")
|
||||||
return containsSlur
|
return containsSlur
|
||||||
|
|
||||||
|
def isRunningInDocker():
|
||||||
|
isD = os.getenv('ISDOCKER')
|
||||||
|
if isD is None:
|
||||||
|
return False
|
||||||
|
return isD == "cat"
|
||||||
|
|
||||||
def hard_shutdown():
|
def hard_shutdown():
|
||||||
current_system_pid = os.getpid()
|
current_system_pid = os.getpid()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user