Shell scripting help (sh 2.0.5)

OT: anything goes!

Moderator: Edi

Post Reply
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

Shell scripting help (sh 2.0.5)

Post by Durandal »

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
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
Post Reply