Exemple #1
0
is_password = False
pgpass_file = pg_home + os.sep + ".pgpass"
if args.pwfile:
    pgpass_file = args.pwfile
    if not os.path.isfile(pgpass_file):
        fatal_error("Error: Invalid --pwfile")

if os.path.isfile(pgpass_file):
    is_password = True
    file = open(pgpass_file, 'r')
    line = file.readline()
    pg_password = line.rstrip()
    file.close()
else:
    if not isSilent:
        pg_password = util.get_superuser_passwd()
        file = open(pgpass_file, 'w')
        file.write(pg_password + '\n')
        file.close()
        is_password = True

if is_password:
    os.chmod(pgpass_file, 0o600)

## LOGS ###############################################
data_root_logs = os.path.join(data_root, "logs")
if not os.path.isdir(data_root_logs):
    os.mkdir(data_root_logs)
pg_log = os.path.join(data_root_logs, pgver)
if not os.path.isdir(pg_log):
    os.mkdir(pg_log)
Exemple #2
0
## PASSWD #############################################
is_password = False
pass_file = ""
if args.pwfile:
    pass_file = args.pwfile
    if not os.path.isfile(pass_file):
        fatal_error("Error: Invalid --pwfile")

if os.path.isfile(pass_file):
    file = open(pass_file, 'r')
    line = file.readline()
    password = line.rstrip()
    file.close()
else:
    password = util.get_superuser_passwd("pgAdmin")

## INITIALIZE #########################################
print('\nInitializing pgAdmin with:')

cmd = "sudo docker pull dpage/pgadmin4"
print("  " + cmd)
err = os.system(cmd)
if err:
    print("rc(" + str(err) + ")")
    fatal_error("Docker run error")

run_options = ""

cmd='sudo docker run --name pgadmin -p ' + str(i_port) + ':80' + \
    ' -e PGADMIN_DEFAULT_EMAIL="' + i_email + '"' + \