pg up xx2

This commit is contained in:
midoks
2022-08-08 14:52:45 +08:00
parent a42f15dae4
commit 5b441d5cb4
7 changed files with 221 additions and 38 deletions
+4 -2
View File
@@ -36,10 +36,9 @@ pg_stop()
}
pg_status()
{
isStart=$(ps aux |grep 'postgres'|grep -v grep|awk '{print $2}')
isStart=$(ps aux | grep 'postgres'| grep -v grep | grep -v 'postgresql status' | awk '{print $2}')
if [ "$isStart" != '' ];then
echo -e "\033[32mPostgreSQL (pid $isStart) already running\033[0m"
else
@@ -50,6 +49,7 @@ pg_status()
pg_reload()
{
echo '' > {$APP_PATH}/logs/server.log
{$APP_PATH}/bin/pg_ctl -D {$APP_PATH}/data -l {$APP_PATH}/logs/server.log reload
}
@@ -62,4 +62,6 @@ case "$1" in
'restart')
pg_stop
pg_start;;
'status')
pg_status;;
esac