#!/bin/sh
# ###############################################################
# Exceed Connection Server 2008
# Copyright (c) 1997-2008 Hummingbird Ltd. All Rights Reserved.
# ###############################################################
# makescripts
# $Revision: 10408 $
# ############################################################### 

# create the shell scripts

Installpath=$1
Files="ecsstart ecsstop ecsinfo keymanager ecsbootstart ecsbootstop"
HeaderFile="sys/scriptHeader"

# create the common header
cat > $HeaderFile << EOF 
#!/bin/sh
#added by installer
Installpath=${Installpath}
EOF

for i in ${Files} ; do
	if [ -r $i ] ; then
	cp $HeaderFile ${i}.tmp
	sed "1,3 d" < $i >> ${i}.tmp
	mv $i ${i}.backup
	mv ${i}.tmp $i
		if [ "$i" = "ecsinfo" ]; then
		chmod 755 $i
		else
		chmod 744 $i
		fi
	fi
done

rm ${HeaderFile}
