mirror of https://github.com/zulip/zulip.git
parent
9d75fd33d9
commit
827babdf29
|
@ -2,6 +2,10 @@
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
vergte() {
|
||||||
|
[ "$1" = "`echo -e "$1\n$2" | sort -V | tail -n1`" ]
|
||||||
|
}
|
||||||
|
|
||||||
cd /
|
cd /
|
||||||
if [ "$EUID" -eq 0 ]; then
|
if [ "$EUID" -eq 0 ]; then
|
||||||
version=$(su postgres -c 'psql -A -t -d postgres -c "show server_version"')
|
version=$(su postgres -c 'psql -A -t -d postgres -c "show server_version"')
|
||||||
|
@ -10,11 +14,11 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
major=$(echo $version | cut -d. -f1,2)
|
major=$(echo $version | cut -d. -f1,2)
|
||||||
pid_style=$(echo "$major > 9.1" | bc -l)
|
|
||||||
username=$1
|
username=$1
|
||||||
|
|
||||||
shift
|
shift
|
||||||
tables=$(echo "'$@'" | sed "s/ /','/g")
|
tables=$(echo "'$@'" | sed "s/ /','/g")
|
||||||
if [ "$pid_style" = "1" ]; then
|
if vergte "$major" "9.2"; then
|
||||||
pidname="pid"
|
pidname="pid"
|
||||||
else
|
else
|
||||||
pidname="procpid"
|
pidname="procpid"
|
||||||
|
|
Loading…
Reference in New Issue