This repository has been archived on 2025-02-12. You can view files and clone it, but cannot push or open issues or pull requests.
NeoStats/makeconf

557 lines
15 KiB
Text
Raw Permalink Normal View History

2002-02-27 11:20:30 +00:00
#!/bin/sh
# makeconf v 1.0 2001/02/11 15:21:32 Shmad
2002-02-27 11:20:30 +00:00
TIME=`date +"%H:%M:%S %Z"`
DATE=`date +"%a, %b %e %Y"`
STATSCONF="neostats.cfg"
2002-02-27 11:20:30 +00:00
SERVNAME="stats.somenet.net"
2003-10-13 11:20:40 +00:00
SERVNUMERIC="1"
COMMENT="NeoStats 2.5 IRC Statistical Server!"
2002-02-27 11:20:30 +00:00
LINKPORT="6667"
LINKSERVER="127.0.0.1"
LINKPASS="LinkPass"
NETNAME="SomeNet-IRC"
NEOHOST="NeoStats.Net"
NEOUSER="Neo"
NEOCHAN="#services"
NEOCONN="10"
NEOREC="10"
BINDIP="127.0.0.1"
LOGFNAMEFORMAT="-%m-%d"
2004-02-03 21:38:06 +00:00
SETSERVERTIMES="24"
2002-02-27 11:20:30 +00:00
# these are so I can use stuff like $1 without it replacing it...like by
# using $dlrsgn$uno for $1
dlrsgn="$"
uno="1"
dos="2"
# remove the temp file if it exists
rm -f mkconf.tmp
# make a quick script for replacing one line with another
cat > repl_str << __EOF__
sed -e "s@^$dlrsgn$uno\(.*\)@$dlrsgn$dos" $STATSCONF > mkconf.tmp
cp mkconf.tmp $STATSCONF
rm mkconf.tmp
__EOF__
# mark repl_str as an executable
chmod +x repl_str
rm -f repl_str
# Checking out how to specify not to make a new line with the current OS
c=''
n=''
2>/dev/null
if [ "`eval echo -n 'a'`" = "-n a" ]; then
c='\c'
else
n='-n'
fi
# If Settings exist, load the info, otherwise tell them to run configure.
if [ -r config.h ]; then
echo "Lets configure this baby.. "
2002-09-01 15:31:12 +00:00
else if [ -r include/config.h ]; then
echo "Lets configure this baby.. "
2002-02-27 11:20:30 +00:00
else
echo ""
echo "It appears you haven't ran configure yet!"
echo "You probably should read the README file too"
echo ""
echo "Type ./configure (If you need help read the README before asking us)"
echo "To enable Service Roots run configure with --enable-auth=sr"
echo ""
2002-02-27 11:20:30 +00:00
exit 1
fi
2002-09-01 15:31:12 +00:00
fi
2002-02-27 11:20:30 +00:00
CONF=$STATSCONF
if [ -r "$CONF" ]; then
echo "$STATSCONF found"
echo " "
echo " You already have ran 'makeconf' I really would suggest"
echo "against running it again since you WILL LOSE all the data"
echo "that is already in your config file!"
echo ""
2002-02-27 11:20:30 +00:00
echo "This script is just for creating one. If you want to recreate"
echo "your config file, type 'recreate'."
2002-02-27 11:20:30 +00:00
echo $n " [exit] -> $c"
read cc
if [ "$cc" != "recreate" ]; then
echo " "
echo " OK, do you want to edit $STATSCONF using an editor?"
echo "If so, specify the editor you want to use. Otherwise,"
echo "type 'exit'."
EDITFND="not found"
if [ -r /usr/bin/pico ]; then
EDITFND="pico"
fi
if [ -r /usr/bin/joe ]; then
EDITFND="joe"
fi
if [ -r /usr/bin/vi ]; then
EDITFND="vi"
fi
if [ -r /usr/bin/vim ]; then
EDITFND="vim"
fi
while [ "c" = "c" ]; do
echo $n " [$EDITFND] -> $c"
read EDITOR
if [ -z "$EDITOR" ]; then
EDITOR="$EDITFND"
fi
if [ "$EDITOR" = "exit" ]; then
echo "Have a nice day."
exit 1
fi
if [ -f $EDITOR ]; then
$EDITOR $CONF
exit 1
fi
if [ -f /usr/bin/$EDITOR ]; then
/usr/bin/$EDITOR $CONF
exit 1
fi
echo " Editor not found. Specify a valid editor or"
echo "type 'exit' to quit this script."
done
fi
mv $CONF "$CONF.saved"
rm $CONF
echo "$STATSCONF has been renamed to ircd.conf.saved"
else
echo "$STATSCONF is not found. (good)"
fi
clear
echo ""
echo "Thanks for Choosing NeoStats!"
echo ""
echo "*----------------------------------------*"
2002-02-27 11:20:30 +00:00
echo "| Welcome to the $STATSCONF generator. |"
echo "*----------------------------------------*"
2002-02-27 11:20:30 +00:00
echo " "
echo "What will your server name be? (ie: $SERVNAME)"
echo $n " [$SERVNAME] -> $c"
read cc
if [ ! -z "$cc" ]; then
SERVNAME="$cc"
fi
echo " "
echo "What is your IRC server's IP? (ie: $LINKSERVER)"
echo $n " [$LINKSERVER] -> $c"
read cc
if [ ! -z "$cc" ]; then
LINKSERVER="$cc"
fi
echo " "
echo "What is the IRCd's Link port? (ie: 7890)"
echo $n " [$LINKPORT] -> $c"
read cc
if [ ! -z "$cc" ]; then
LINKPORT="$cc"
fi
echo " "
echo "What is the IRCd's Link password for stats? (ie: bleh)"
echo $n " [$LINKPASS] -> $c"
read cc
if [ ! -z "$cc" ]; then
LINKPASS="$cc"
fi
echo " "
echo "NeoStats Server comment?"
echo $n " [$COMMENT] -> $c"
read cc
if [ ! -z "$cc" ]; then
COMMENT="$cc"
fi
echo " "
echo "Network name? (refer to your networks file. ie: CyberChat-IRC)"
echo $n " [$NETNAME] -> $c"
read cc
if [ ! -z "$cc" ]; then
NETNAME="$cc"
fi
echo " "
echo "The host NeoStats is connecting from, most people use services.theirnetwork.net"
echo $n " [$NEOHOST] -> $c"
read cc
if [ ! -z "$cc" ]; then
NEOHOST="$cc"
fi
echo " "
echo "NeoStats User? (This is the part before @yourhost.net)"
echo $n " [$NEOUSER] -> $c"
read cc
if [ ! -z "$cc" ]; then
NEOUSER="$cc"
fi
echo " "
echo "What channel should NeoStats join on IRC?"
echo $n " [$NEOCHAN] -> $c"
read cc
if [ ! -z "$cc" ]; then
NEOCHAN="$cc"
fi
echo " "
echo "Time in seconds we wait before attempting to reconnect to the server on a split?"
echo $n " [$NEOCONN] -> $c"
read cc
if [ ! -z "$cc" ]; then
NEOCONN="$cc"
fi
echo " "
echo "What IP should NeoStats Bind to? (ie: $BINDIP)"
echo "This is optional. See neostats.cfg for more information"
echo $n " [$BINDIP] -> $c"
read cc
if [ ! -z "$cc" ]; then
BINDIP="$cc"
fi
2002-02-27 11:20:30 +00:00
cat > $CONF << __EOF__
##################################################
## Configuration file for NeoStats
## Created: $DATE - $TIME
## NeoStats (c) 1999-2003 The NeoStats Group.
2002-03-28 16:29:09 +00:00
## Web: http://www.NeoStats.Net
## File Revision: 2.5.6-1
##################################################
##################################################
#Each of the options has an indicator as follows:
# [REQUIRED] - must be set or NeoStats will not run.
# [RECOMMENDED] - optional but may cause problems if not set.
# [OPTIONAL] - optional and the feature will be disabled if not set.
# [DISCOURAGED] - may cause undesirable side effects if enabled.
#Although we have included instructions for each setting in this file
#you can refer to the README file for more information
2002-02-27 11:20:30 +00:00
##################################################
##############################
# IRCd Linking Configuration #
##############################
# SERVER_NAME <hostname> [REQUIRED]
# Specifies the name of the NeoStats Server as it will appear on
# the network. e.g.
#
# SERVER_NAME stats.neostats.net
#
# When NeoStats links, it will appear as stats.neostats.net.
2002-02-27 11:20:30 +00:00
SERVER_NAME $SERVNAME
# SERVER_PORT <port number> [REQUIRED]
# Specifies the port to connect to on the IRC Server e.g.
#
# SERVER_PORT 6667
#
# When connecting, NeoStats will connect to port 6667
2002-02-27 11:20:30 +00:00
SERVER_PORT $LINKPORT
# CONNECT_TO <ip address> [REQUIRED]
# Specifies the IP address to connect to. e.g.
#
# CONNECT_TO 127.0.0.1
#
# This will force stats to connect to 127.0.0.1
2002-02-27 11:20:30 +00:00
CONNECT_TO $LINKSERVER
# CONNECT_PASS <link password> [REQUIRED]
# Specifies the password used to connect. This must match your C/N
# lines in your IRCD configuration e.g.
#
# CONNECT_PASS linkpass
#
# Send "linkpass" as the password to connect
2002-02-27 11:20:30 +00:00
CONNECT_PASS $LINKPASS
# SERVER_INFOLINE <info line> [REQUIRED]
# Specify the description of the server that
# appears when you do /links e.g.
#
# SERVER_INFOLINE Network Auxiliary Services
2002-02-27 11:20:30 +00:00
SERVER_INFOLINE "$COMMENT"
2002-02-27 11:20:30 +00:00
2003-10-13 11:20:40 +00:00
# SERVER_NUMERIC <numeric> [RECOMMENDED]
# Specify the numeric of the server to send on connect.
# This must be a value between 1 and 254, and must not be in use by
# any other IRC server on the network.
# Currently only Unreal IRCd uses this option.
#
# SERVER_NUMERIC 1
SERVER_NUMERIC "$SERVNUMERIC"
# STATSERV_NETNAME <network name> [REQUIRED]
# Your network name, if unknown refer to your network file. Does not
# apply to all IRCDs e.g.
#
# STATSERV_NETNAME neostats
#
# For irc.neostats.net
2002-02-27 11:20:30 +00:00
STATSERV_NETNAME $NETNAME
2002-02-27 11:20:30 +00:00
##########################
# NeoStats Configuration #
##########################
# NEOSTAT_HOST <host> [REQUIRED]
# Specifies the Hostname that NeoStats comes from. Some people like to
# make it the same as the Services host (e.g., services.neostats.net)
# or one just for NeoStats (e.g., stats.neostats.net) e.g.
#
# NEOSTATS_HOST stats.neostats.net
#
# The bot will appear as NeoStats!user@stats.neostats.net
2002-02-27 11:20:30 +00:00
NEOSTAT_HOST $NEOHOST
# NEOSTAT_USER <user> [REQUIRED]
# Specifies the User/ident of the NeoStats Bot (the part before the
# @host) e.g.
#
# NEOSTATS_USER neo
#
# The bot will apear as NeoStats!neo@Host
2002-02-27 11:20:30 +00:00
NEOSTAT_USER $NEOUSER
# SERVICES_CHAN #<channel name> [REQUIRED]
# Specify the channel that all bots on NeoStats
# will automatically join, and echo out any
# important information e.g.
#
# SERVICES_CHAN #services
#
# Makes NeoStats, and all the other bots join #services channel on
# start-up/load.
2002-02-27 11:20:30 +00:00
SERVICES_CHAN $NEOCHAN
# NO_LOAD [YOU MUST REMOVE THIS]
# If this is in the neostats.cfg your NeoStats WILL NOT START UP. To
# disable this simply comment this line out. e.g.
#
# NO_LOAD <- NeoStats will not load.
#
# #NO_LOAD <- NeoStats will load.
NO_LOAD
# WANT_PRIVMSG [DISCOURAGED]
# Specify if the bots should send all messages as privmsgs or as
# notices (Most Services use notice) e.g.
#
# WANT_PRIVMSG
#
# If present, will send all messages as privmsgs (if commented out,
# it will send as Notices) *NOTE:* This option Violates IRC RFC, and
# can cause flooding problems on your network. Its NOT recommended.
2002-03-28 16:29:09 +00:00
#WANT_PRIVMSG
2002-02-27 11:20:30 +00:00
# RECONNECT_TIME <seconds> [RECOMMENDED]
# If NeoStats server gets split from the network, how long to wait
# before attempting to reconnect to the network. A value of 0 will
# cause NeoStats to shutdown and not attempt to reconnect. e.g.
#
# RECONNECT_TIME 10
#
# Specifies wait 10 seconds before trying to reconnect
#
# RECONNECT_TIME 0
#
# Tells NeoStats to never reconnect to the network
#
# If not specified, NeoStats will default to 10 seconds.
2002-02-27 11:20:30 +00:00
RECONNECT_TIME $NEOCONN
# ONLY_OPERS [OPTIONAL]
# Restrict NeoStats and StatServ to opers use only.
# If not specified, users will have some access to NeoStats
# and StatServ commands. e.g.
#
# ONLY_OPERS
#
# Only opers may use NeoStats and StatServ.
#ONLY_OPERS
# BINDTO [OPTIONAL]
# Make NeoStats bind to a particular IP Address. If not
# specified NeoStats will attempt to find this address
# itself. e.g.
#
# BINDTO 203.203.123.12
#
# All outgoing connections from NeoStats will originate from this
# IP address
# This IP address should not be localhost (127.0.0.1)
2002-07-26 04:39:23 +00:00
#BINDTO $BINDIP
2002-02-27 11:20:30 +00:00
# LOGFILENAMEFORMAT <format> [OPTIONAL]
# Defines the format for dated log files. This allows you to choose
# what date format is used for log file names when they are rotated at
# midnight. The option uses the parameters passed to strftime so you
# can use any options valid for that function. Common ones are:
# %a Abbreviated weekday name
# %A Full weekday name
# %b Abbreviated month name
# %B Full month name
# %d Day of month as decimal number (01 <20> 31)
# %m Month as decimal number (01 <20> 12)
# %y Year without century, as decimal number (00 <20> 99)
# %Y Year with century, as decimal number
#
# Examples using 30 September 2003 as the date:
# For NeoStats0930.log:
#
# LOGFILENAMEFORMAT %m%d
#
# For NeoStats20030930.log:
#
# LOGFILENAMEFORMAT %Y%m%d
#
# If not defined, the default is the original NeoStats log format of
# "-%m-%d" i.e. NeoStats-09-30.log
#LOGFILENAMEFORMAT $LOGFNAMEFORMAT
2004-02-03 21:38:06 +00:00
# SETSERVERTIMES <INTERVAL> [OPTIONAL]
# Cause NeoStats to sync server times at the given interval
# INTERVAL is an integer representing the number of hours
#
# Examples
#
# SETSERVERTIMES 24
#
# Cause NeoStats to sync server times every 24 hours
# If not present, NeoStats will not sync times.
# This option only works on Unreal servers and defaults to
2004-02-03 21:54:11 +00:00
# a sync interval of 24 hours. Enabling this option will also
# cause NeoStats to sync servers when it first joins the
# network.
2004-02-03 21:38:06 +00:00
SETSERVERTIMES 24
2002-02-27 11:20:30 +00:00
#####################################
# Module Configurations and Loading #
#####################################
# LOAD_MODULE <module name> [OPTIONAL]
# What modules to load at start-up. e.g.
#
# LOAD_MODULE statserv
#
# Will load up StatServ at boot
#
# Multiple instances of LOAD_MODULE may be specified
2002-02-27 11:20:30 +00:00
# this is the StatServ Module
#LOAD_MODULE statserv
2002-02-27 11:20:30 +00:00
#This is a new module. LoveServ, send a rose, hug, kiss, chocolate, etc to that
# Special IRC Somebody. :D
2002-03-28 16:29:09 +00:00
#LOAD_MODULE loveserv
2002-02-27 11:20:30 +00:00
# The HostServ module provides vhost services
#LOAD_MODULE hostserv
# MoraleServ. A fun module to cheer people up.
#LOAD_MODULE moraleserv
# ConnectServ will watch all connections to the network and can report them
# to the services channel. It can also watch and report Nickname changes.
#LOAD_MODULE connectserv
2002-02-27 11:20:30 +00:00
2002-03-28 16:29:09 +00:00
########################################
# NeoStats ROOT users (ExtAuth module) #
########################################
2002-03-28 16:29:09 +00:00
#SERVICE_ROOTS <nick!user@host> [OPTIONAL]
# Who should get access to NeoStats regardless of their O line flags.
# You can specify this option up to 10 times to specify different
# nicks who will be allowed this privilege. e.g.
#
# SERVICE_ROOTS fish!?Fish@*.neostats.net
#
# Will give "fish" access to NeoStats Privileged commands if fish has
# Umode +r and comes from the specified hostname and ident.
2002-07-27 04:12:35 +00:00
#SERVICE_ROOTS Shmad!?Shmad@Coder.NeoStats.net
#SERVICE_ROOTS ^Enigma^!*@*.au
#SERVICE_ROOTS Fish!?Fish@*.dynam.ac
2002-07-27 04:12:35 +00:00
# Options for configuring StatServ are set on IRC. Load StatServ and type
# /msg statserv help set.
2002-02-27 11:20:30 +00:00
###############################################################################
## End of Configuration ##
###############################################################################
__EOF__
# Make it so ONLY the one who created the conf can read or write.
chmod 700 $STATSCONF
echo ""
echo "*------------------------------------------------*"
2002-02-27 11:20:30 +00:00
echo "| Thanks for choosing NeoStats. Have a nice day. |"
echo "| Please check neostats.cfg for any errors. |"
echo "*------------------------------------------------*"
2002-03-28 16:29:09 +00:00
echo "| Also make sure modules are compiled and in the |"
echo "| neostats.cfg properly for them to work :) |"
2002-03-28 16:29:09 +00:00
echo "*------------------------------------------------*"
echo "| If you configured with --enable-auth=sr |"
echo "| Edit neostats.cfg and edit the proper section |"
echo "| to enable Service ROOTS. |"
2002-07-27 04:12:35 +00:00
echo "*------------------------------------------------*"
echo "| **I CANT STRESS THIS ENOUGH, PLEASE READ THE** |"
echo "| **README FILE BEFORE ASKING FOR HELP!!!!! ** |"
echo "*------------------------------------------------*"
echo "| This file was updated by M (mark@ctcp.net) |"
2003-08-14 13:23:03 +00:00
echo "*------------------------------------------------*"
echo
2002-02-27 11:20:30 +00:00
exit 1