diff --git a/agents/plugins/mk_db2.aix b/agents/plugins/mk_db2.aix index 4f8bf8f6223..08dbc731d64 100755 --- a/agents/plugins/mk_db2.aix +++ b/agents/plugins/mk_db2.aix @@ -1,4 +1,4 @@ -#!/usr/bin/ksh +#!/usr/bin/ksh93 # Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2 # This file is part of Checkmk (https://checkmk.com). It is subject to the terms and # conditions defined in the file COPYING, which is part of this source code package. @@ -65,11 +65,11 @@ function waitmax { function query_instance { INSTANCE=$1 # find home directory - HOMEDIR=$(grep "^$INSTANCE" /etc/passwd | awk -F: '{print $6}' | grep "$INSTANCE$") + HOMEDIR=$(grep -w "^$INSTANCE:" /etc/passwd | awk -F: '{print $6}') NOW=$(perl -e "print time();") waitmax 200 < /dev/null; - if [ $? -nq 0 ] ; then + if [ $? -ne 0 ] ; then exit 1 fi