#!/bin/ksh # Program: disable_ai # Purpose: This script acts as a wrapper for the sub_disable_ai # script. Allowing one or all databases to have AI disabled # at the same time. # Syntax: disable_ai # Author: Adam Backman # Date: 06/08/98 # SCRIPTS=/u3/users/adamb/scripts HOSTNAME=`hostname` export SCRIPTS HOSTNAME case $1 in all|ALL|All) for i in `grep $HOSTNAME $SCRIPTS/live/db.registry | cut -s -f 1 -d "|" ` do if [ $i != "#DB" ] then . $SCRIPTS/live/read_registry $i if [ $? != "0" ] then echo "" >/dev/null else echo "Working on database: $i" $SCRIPTS/live/sub_disable_ai $i fi fi done ;; *) . $SCRIPTS/live/read_registry $1 case $? in 2) echo "Database $1 is not in database registry" exit 1 ;; 3) echo "Database $1 is on $HOST not on this host" exit 1 ;; esac echo "Working on database: $1" $SCRIPTS/live/sub_disable_ai $1 ;; esac