Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions 1.14.5/bullseye/entrypoint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python3

"""
Docker entrypoint for Dogecoin Core
"""
import argparse
import os
import pwd
Expand All @@ -23,7 +25,8 @@ def execute(executable, args):
executable_path = shutil.which(executable)

if executable_path is None:
exit(f"{sys.argv[0]}: {executable} not found.")
print(f"{sys.argv[0]}: {executable} not found.", file=sys.stderr)
sys.exit(1)

#Prepare execve args & launch container command
execve_args = [executable_path] + args
Expand All @@ -47,7 +50,7 @@ def executable_options(executable):
man_folder = "/usr/share/man/man1"
man_file = os.path.join(man_folder, f"{executable}.1")

with open(man_file, "r") as man_filestream:
with open(man_file, "r", encoding="utf-8") as man_filestream:
man_content = man_filestream.read()

# Regex to match single option entry in man(1) page
Expand Down Expand Up @@ -77,7 +80,7 @@ def create_datadir():
os.makedirs(datadir, exist_ok=True)

user = os.environ["USER"]
subprocess.run(["chown", "-R", f"{user}:{user}", datadir])
subprocess.run(["chown", "-R", f"{user}:{user}", datadir], check=True)

def convert_env(executable):
"""
Expand Down Expand Up @@ -131,6 +134,9 @@ def run_executable(executable, executable_args):
execute(executable, executable_args)

def main():
"""
Main routine
"""
if sys.argv[1].startswith("-"):
executable = "dogecoind"
else:
Expand Down