#!/bin/csh -f
# source this file to write current config file values
set basedir=`dirname $0`
cd $basedir
# determine which Ex Libris application
source util_sp_set_app


echo "Writing configuration..."
if (-e $sp_conf.bak) then
    mv $sp_conf.bak $sp_conf.bak.`date "+%Y%m%d.%H%M%S"`
endif
if (-e $sp_conf) then
    mv $sp_conf $sp_conf.bak
endif
echo "# This file was created automatically - do not edit" > $sp_conf
foreach var ( ftp_server ftp_user sp_dir exl_mail cust_code cust_mail language  mail_exl_flag )
    eval if '(! $?'$var')' set $var
    eval echo set $var = '\"$'$var'\"' >> $sp_conf
end
echo "# End of config" >> $sp_conf
