Shell scripting help (sh 2.0.5)
Posted: 2003-04-01 06:35pm
Okay, I'm trying to write a shell script that'll run under sh-2.0.5 to check for a binary in /usr/local/bin, and if it exists, prompt the user to remove it, and if not, continue with the install. It's the Cisco VPN Client for Mac OS X. It just won't work. It keeps giving me an "unexpected end of file" error. Here's the source. I'd appreciate any help.
Code: Select all
#! /bin/sh
set BINARY = vpnclient
set RESPONSE
cd /usr/local/bin
if [ -e $BINARY ]
then
echo "You have not uninstalled your previous version of the Cisco VPN Client. Would you like to uninstall now? Please enter 'y' or 'n'."
read RESPONSE
if [ $RESPONSE = "y" ]
then
sudo vpn_uninstall
else if [ $RESPONSE = "n" ]
then
echo "Be sure to uninstall the previous version of the Cisco VPN Client before installing the new version. You can do this by either typing 'sudo vpn_uninstall' at the command line or by running this installer again."
exit 0
endif
else if [ ! -e $BINARY ]
then
cd /etc
sudo mkdir CiscoSystemsVPNClient
cd CiscoSystemsVPNClient
sudo mkdir Profiles
cd `dirname $0`
sudo cp InstallerData/ISU.pcf /etc/CiscoSystemsVPNClient/Profiles/ISU.pcf
endif
open InstallerData/CiscoVPN.app
exit 0