#!/bin/sh
#############################################################################
#
# Licensed Materials - Property of IBM
#
# 5648-B90
# (C) COPYRIGHT International Business Machines Corp. 1998
#
# 5648-B91
# (C) COPYRIGHT International Business Machines Corp. 1998
#
# 5648-B95
# (C) COPYRIGHT International Business Machines Corp. 1998
#
# 5648-B97
# (C) COPYRIGHT International Business Machines Corp. 1998
#
# 5648-B99
# (C) COPYRIGHT International Business Machines Corp. 1998
#
# 5648-B96
# (C) COPYRIGHT International Business Machines Corp. 1998
#
# 5648-B98
# (C) COPYRIGHT International Business Machines Corp. 1998
#
# All Rights Reserved
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
#############################################################################
#
# NAME: db2iauto
#
# FUNCTION: db2iauto - enable/disable autostarting of an instance
#
# USAGE: db2iauto
#
#############################################################################

DB2DIR="/usr/IBMdb2/V6.1"

# Display the DB2ADMINSERVER registry variable
if [ -x /usr/IBMdb2/V6.1/instance/db2iset ]; then
    cmd="/usr/IBMdb2/V6.1/instance/db2iset"
else
    cmd="db2set"
fi

if   [ $# -eq 2 -a "X$1" = "X-on"  ]; then
    ${cmd?} -i $2 DB2AUTOSTART=YES
elif [ $# -eq 2 -a "X$1" = "X-off" ]; then
    ${cmd?} -i $2 DB2AUTOSTART=
else
    echo "DB2I1024I Usage: $0 [-h|-?] -on|-off InstName"
fi

# Successful exit.
exit 0
