#!/bin/sh
printf "\taviation setup v1.1c by Mixter\n"
printf "\nsearching for eggdrop... "
if test ! -r eggdrop ;then
printf "not found\n\nplease compile eggdrop AND the modules first\n"
printf "because this script removes unneccessary files like source\n"
exit 1
fi
printf "found\nsearching for aviation.tcl... "
if test ! -r aviation.tcl ;then
printf "not found\n\n---STOP---\n"
exit 1
fi
printf "found\nsearching for quench.c... "
if test ! -r quench.c ;then
printf "not found\n\n---STOP---\n"
exit 1
fi
printf "found\ncompiling... "
cc quench.c -o quench
strip quench;chmod 500 quench
if test ! -r quench ;then
printf "error :/\n"
exit 1
fi
printf "done\nsearching for avi.conf... "
if test ! -r avi.conf ;then
printf "no avi.conf?\ncreating it... "
cat >avi.conf<<EOF
#!./eggdrop
#EDIT THIS! THIS IS THE FILE YOU START EGGDROP WITH
set nick1 "nickname"
set username "username"
set realname "real name"
set owner "aviation"
set allport "3333"
set useport "0"
set botport "4444 5555"
set botchans "#lamest #botcentral"
set network "EFNET"
source aviation.tcl
EOF
fi
chmod +x avi.conf
printf "ok\nremoving unneccessary files, ctrl-c to abort... "
sleep 5
rm -rf .* C* D* E* F* I* M* N* R* config* doc eggdrop.* 1>/dev/null 2>/dev/null
rm -rf *log klines lush.* motd pid.* *.c o* scripts src 1>/dev/null 2>/dev/null
if test -z $1 ;then
printf "done\nno parameter given, skipping to rename eggdrop\n"
printf "\nnow edit avi.conf\n"
exit 0
fi
printf "done\nrenaming eggdrop to "$1"... "
mv eggdrop $1 ; cat avi.conf|grep -v "/eggdrop">atmp
rm -f avi.conf;echo "#!./"$1 >avi.conf;cat atmp>>avi.conf
chmod +x avi.conf ; rm -f atmp
printf "done, avi.conf updated\n\nnow edit avi.conf\n"
exit 0
