1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 00:33:14 +02:00
Files
anope/bin/register
T
ribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b ef536a1816 BUILD : 1.7.3 (176) BUGS : NOTES : Added check to make sure register script was being run from within the bin/ directory. If ./bin/register was used, the path to cache file would be incorrect (../config.cache)
git-svn-id: svn://svn.anope.org/anope/trunk@176 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@123 5417fbe8-f217-4b02-8779-1006273d7864
2004-06-07 15:53:22 +00:00

102 lines
3.2 KiB
Bash
Executable File

#!/bin/sh
###############################################
# Set Variables
###############################################
# CONFIGURATION CACHE (e.g. ../config.cache)
CACHEFILE="../config.cache"
# REGISTRATION INFORMATION CACHE FILE (no need to alter this)
REGCACHE="register.cache"
# SENDMAIL PATH
SENDMAIL="/usr/sbin/sendmail"
# SCRIPT VERSION NUMBER (DO NOT ALTER)
REGISTERVERSION="1.2"
# DO NOT CHANGE IF YOU WANT TO REGISTER WITH ANOPE
REGISTRYADDRESS="register@anope.org"
################################################
# END OF CONFIGURATION
# YOU ARE NOT REQUIRED TO CHANGE ANYTHING BELOW
################################################
if [ $0 != "./register" ] ; then
echo "Warning: Run this file while in the /bin/ directory (e.g. ./register)"
exit 1
fi
if [ ! -f $CACHEFILE ] ; then
echo "Warning: Configuration cache file missing. Run ./configure"
exit 1
fi
if [ ! -f $SENDMAIL ] ; then
echo "Warning: Sendmail cannot be found. Please open this file and set variable correctly"
exit 1;
fi
clear
if [ -f $REGCACHE ] ; then
echo "Previous registration cache file found. Removing..."
rm $REGCACHE
fi
echo "##################################################"
echo "Anope registration script (v$REGISTERVERSION)"
echo "##################################################"
echo "This script allows you to register your network"
echo "with the Anope central registry. This gives us"
echo "an idea of how many networks use Anope and what options"
echo "they compile with so we can spend more time developing"
echo "options that are more widely used. Note: The options"
echo "you selected in ./configure will be sent."
echo "You will be asked a series of questions, if you wish"
echo "to be listed in the public network database all the"
echo "information will be required."
echo "NOTE: NO PRIVATE OR SENSITIVE INFORMATION WILL BE SENT"
echo "##################################################"
echo "Would you like to register? [Type YES to continue]"
read answer
if [ $answer = "YES" ] ; then
echo "Beginning registration..."
echo "1. What is your network name? (e.g. Anope IRC Network)"
read NETWORKNAME
echo CONNECTADDRESS=\"$NETWORKNAME\" >> $REGCACHE
echo "2. What is your network's connection address (e.g. irc.anope.org)"
read CONNECTADDRESS
echo CONNECTADDRESS=\"$CONNECTADDRESS\" >> $REGCACHE
echo "3. Primary contact email address? (e.g. irc-admin@anope.org)"
read CONTACTEMAIL
echo CONTACTEMAIL=\"$CONTACTEMAIL\" >> $REGCACHE
echo "4. What is your network's website address (e.g. http://www.anope.org)"
read WEBSITEADDRESS
echo WEBSITEADDRESS=\"$WEBSITEADDRESS\" >> $REGCACHE
echo "5. Would you like your network to be listed in a public database?"
echo "[Please type YES if you would like to be listed]"
read LISTED
echo LISTED=\"$LISTED\" >> $REGCACHE
echo "6. (Bonus Devel-Only Question) Why did the chicken cross the road?!"
read BONUS
echo BONUS=\"$BONUS\" >> $REGCACHE
echo >> $REGCACHE
echo "Processing registration..."
cat $CACHEFILE >> $REGCACHE
$SENDMAIL $REGISTRYADDRESS < $REGCACHE
if [ -f $REGCACHE ] ; then
echo "Cleaning up..."
rm $REGCACHE
fi
echo "Registration Competed. Thank you for registering Anope."
exit 0;
fi
echo "Registration Cancelled"