From fdf6cea2b146233d8b5f4b3fbbb123a12a85d71b Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Sun, 10 Jun 2018 13:56:07 +0200 Subject: [PATCH] postgresql_transactions: change from bash to sh; fix shellcheck issues --- plugins/postgresql/postgresql_transactions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/postgresql/postgresql_transactions b/plugins/postgresql/postgresql_transactions index c127e633..47db7b64 100755 --- a/plugins/postgresql/postgresql_transactions +++ b/plugins/postgresql/postgresql_transactions @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Plugin to monitor PostgreSQL Commits and Rollbacks in Transactions # @@ -42,4 +42,4 @@ if [ "$1" = "config" ]; then echo 'rollbacks.info Number of transaction rollbacks per second.' exit 0 fi -psql -h ${dbserver} -U ${dbuser} -tc "SELECT 'commits.value '||SUM(xact_commit)::TEXT||E'\nrollbacks.value '||SUM(xact_rollback)::TEXT FROM pg_stat_database;" --no-align +psql -h "$dbserver" -U "$dbuser" -tc "SELECT 'commits.value '||SUM(xact_commit)::TEXT||E'\\nrollbacks.value '||SUM(xact_rollback)::TEXT FROM pg_stat_database;" --no-align