#!/bin/sh

# This file is part of the aMule project.
#
# Copyright (c) 2003-2011 aMule Team ( admin@amule.org / http://www.amule.org )
# Copyright (c) 2006-2011 Werner Mahr (Vollstrecker) ( amule@vollstreckernet.de )
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
#

prefix=/usr
exec_prefix=/usr
# ADUNANZA BEGIN
# xas_bin=/usr/lib64/xchat/plugins/xas.pl
xas_bin=/usr/lib64/xchat/plugins/xasAdunanzA.pl
# ADUNANZA END

if [ -z $xas_bin ] ; then
# ADUNANZA BEGIN
	# echo "xas.pl: Plugin not found"
	echo "xasAdunanzA.pl: Plugin not found"
# ADUNANZA END
	exit 0
fi

if [ -d ~/.xchat2 ] ; then
# ADUNANZA BEGIN
# 	if [ -e ~/.xchat2/xas.pl ] ; then
# 		rm ~/.xchat2/xas.pl
# 	fi
# 	ln -s $xas_bin ~/.xchat2/xas.pl && echo "autostart successfully added"
 	if [ -e ~/.xchat2/xasAdunanzA.pl ] ; then
		rm ~/.xchat2/xasAdunanzA.pl
	fi
	ln -s $xas_bin ~/.xchat2/xasAdunanzA.pl && echo "autostart successfully added"
# ADUNANZA END
	if  ps -A | grep -q xchat ; then
# ADUNANZA BEGIN
#		echo "You have to restart XChat to autoload xas.pl"
 		echo "You have to restart XChat to autoload xasAdunanzA.pl"
# ADUNANZA END
 	fi
else
	echo "XChat-Datadir not found"
fi
