Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUP-20798: fixes shebang, HOMEDIR grep, su shell, if -ne typo #761

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions agents/plugins/mk_db2.aix
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 <<WAITMAX
su $INSTANCE << EOF
su - $INSTANCE -c "/usr/bin/ksh93" << EOF

if [ ! -f $HOMEDIR/sqllib/db2profile ] ;
then
Expand Down Expand Up @@ -99,7 +99,7 @@ function query_instance {
DB_PORT='port 0'
for DB in \\\$DBS; do
db2 connect to \\\$DB > /dev/null;
if [ $? -nq 0 ] ; then
if [ $? -ne 0 ] ; then
exit 1
fi

Expand Down
Loading