Update start.py
This commit is contained in:
committed by
GitHub
parent
d856b0eed4
commit
ed830d713d
28
start.py
28
start.py
@@ -131,17 +131,17 @@ services:
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
""")
|
||||
def main():
|
||||
start_operation = not (args.stop or args.restart)
|
||||
|
||||
start_operation = not (args.stop or args.restart)
|
||||
|
||||
if args.build and not os.path.isfile("./Dockerfile"):
|
||||
if args.build and not os.path.isfile("./Dockerfile"):
|
||||
puts("This is not a clone of firegex, to build firegex the clone of the repository is needed!", color=colors.red)
|
||||
exit()
|
||||
|
||||
if args.threads < 1:
|
||||
if args.threads < 1:
|
||||
args.threads = multiprocessing.cpu_count()
|
||||
|
||||
if start_operation and (not args.build or args.keep):
|
||||
if start_operation and (not args.build or args.keep):
|
||||
if check_if_exists("docker ps --filter 'name=^firegex$' --no-trunc | grep firegex"):
|
||||
if args.keep:
|
||||
write_compose()
|
||||
@@ -153,8 +153,8 @@ if start_operation and (not args.build or args.keep):
|
||||
puts(" will start on port ", end="")
|
||||
puts(f"{args.port}", color=colors.cyan)
|
||||
|
||||
psw_set = None
|
||||
if start_operation:
|
||||
psw_set = None
|
||||
if start_operation:
|
||||
if args.psw_no_interactive:
|
||||
psw_set = args.psw_no_interactive
|
||||
elif not args.startup_psw:
|
||||
@@ -168,10 +168,10 @@ if start_operation:
|
||||
else:
|
||||
break
|
||||
|
||||
write_compose(psw_set)
|
||||
write_compose(psw_set)
|
||||
|
||||
sep()
|
||||
if not args.no_autostart:
|
||||
sep()
|
||||
if not args.no_autostart:
|
||||
try:
|
||||
if args.restart:
|
||||
puts("Running 'docker-compose restart'\n", color=colors.green)
|
||||
@@ -188,6 +188,12 @@ if not args.no_autostart:
|
||||
finally:
|
||||
if not args.keep:
|
||||
os.remove(composefile)
|
||||
else:
|
||||
else:
|
||||
puts("Done! You can start/stop firegex with docker-compose up -d --build", color=colors.yellow)
|
||||
sep()
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
print()
|
||||
|
||||
Reference in New Issue
Block a user