#!/bin/sh
#
# del_hl
#
# Usage: del_hl
#
# This script will DELETE all scripts in INDEX
# from all HL 50/51 stations.
#
# By: Angel Corbera
#
echo "\nAbout to start DELETING all utilities in INDEX"
echo "from ALL 50/51 stations in this system!!!!"
echo "Do you want to continue (y/n)?"
read answer
if [ $answer = "n" ]
then
exit 1
fi
cd /opt/ac
rm utils.ftp > /dev/null 2>&1
touch utils.ftp
#
# Creating temporary file utils.ftp from INDEX
#
echo "user root xxxxxx" >> utils.ftp
echo "ascii" >> utils.ftp
echo "cd /opt/ac" >> utils.ftp
files=`awk '{print $1}' INDEX`
for y in $files
do
echo "delete $y" >> utils.ftp
done
echo "bye" >> utils.ftp
#
for x in AW01 WP01 WP02 WP03 WP04 WP05 WP06
do
echo "Deleting UTILITIES from HL$x"
ftp -n HL$x < utils.ftp
echo "Done!\n"
done
#
echo "Done!\n"