Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/pgadmin/pg_init.sh

30 lines
659 B

7 months ago
#!/bin/bash
7 months ago
7 months ago
python_ver=`ls /www/server/pgadmin/run/lib/ | grep python | cut -d \ -f 1 | awk 'END {print}'`
7 months ago
email=$1
email_pwd=$2
7 months ago
expect <<-EOF
set time 10
7 months ago
spawn gunicorn --bind unix:/tmp/pgadmin4.sock \
--workers=1 \
--threads=25 \
7 months ago
--chdir /www/server/pgadmin/run/lib/${python_ver}/site-packages/pgadmin4 pgAdmin4:app
7 months ago
expect {
7 months ago
"Email address:" { send "${email}\r"; exp_continue }
"Password" { send "${email_pwd}\r"; exp_continue }
"Retype password" { send "${email_pwd}\r" }
7 months ago
}
expect eof
7 months ago
EOF
7 months ago
pids=$(ps aux | grep 'pgAdmin4:app' | grep -v grep | awk '{print $2}')
arr=($pids)
for p in ${arr[@]}
do
kill -9 $p > /dev/null 2>&1
done
7 months ago