#!/bin/bash
# skip crab_syntax

check() {
	source /opt/CONFIG
	if [ "${POSTGRESQL_ENABLED:-TRUE}" = 'TRUE' ]; then
		local pidfile=/var/run/postgresql/13-main.pid
		if [ -s "$pidfile" ] && [ ! -d "/proc/$(cat $pidfile)" ]; then
			return 1
		fi
	fi
	return 0
}

error() {
	echo "ALARM Не запущен сервис postgresql"
	echo
	return 0
}

fix() {
	/etc/init.d/postgresql stop
	/etc/init.d/postgresql start
	return 0
}

. /usr/local/lib/angel main
