#!/bin/sh
#
#  get_mycps
#
#  Usage:  get_mycps
#
#  By:  Angel Corbera, TSID1, Refinery Isla, Curacao, N.A.
#
#  Purpose:  to create file MYCPS with a list of all CP/GWs
#  hosted by this AP/AW.
#
cd /opt/ac
echo "Getting CP names hosted by this AP..."
ME=`uname -n`
CPS=`sort /etc/cplns`
rm MYCPS > /dev/null 2>&1
touch MYCPS
grep -v vol /usr/fox/sp/sldb > tmp1
awk '{print $1, $2}' tmp1 | grep $ME > tmp2
for x in $CPS
do
   awk ' $1=="'$x'" {print $1}' tmp2 >> MYCPS
done
cat MYCPS
