#!/bin/sh
# Adds a server to servers.ini

echo
echo "Darkbot has a dynamic server list, where if the bot is"
echo "killed, it'll connect to the next server in the list. You can"
echo "have as many servers in this list as you wish."
echo
while [ -z "$SERV" ]
do
	echo -n "Enter a server name: "
	read SERV
	if [ -z "$SERV" ]; then
		echo "You MUST specify a server!"
		sleep 1
		echo
	fi
done
while [ -z "$PORT" ]
do
	echo
	echo -n "What port to connect to on $SERV? [6667] "
	read PORT
	if [ -z "$PORT" ]; then
		echo "Defaulting to 6667..."
		PORT=6667 
		sleep 1
		echo
	fi
done

echo "$SERV $PORT (Added: `date`)" >> dat/servers.ini
echo
echo "$SERV:$PORT has been added to dat/servers.ini"
echo
sleep 2
