diff options
author | Sven Wegener <swegener@gentoo.org> | 2004-09-12 03:27:05 +0000 |
---|---|---|
committer | Sven Wegener <swegener@gentoo.org> | 2004-09-12 03:27:05 +0000 |
commit | 0b09ecd94a9f1f78e32e96e1448aad0ce3be935a (patch) | |
tree | c6d44e7d101a2564b947b277867e3dad83149e87 /net-irc/eggdrop/files | |
parent | Added bash-completion script (please test). (Manifest recommit) (diff) | |
download | gentoo-2-0b09ecd94a9f1f78e32e96e1448aad0ce3be935a.tar.gz gentoo-2-0b09ecd94a9f1f78e32e96e1448aad0ce3be935a.tar.bz2 gentoo-2-0b09ecd94a9f1f78e32e96e1448aad0ce3be935a.zip |
Added documentation to eggdrop-installer about how to create the user file and how to start the bot correctly. Closes bug #63578.
Diffstat (limited to 'net-irc/eggdrop/files')
-rw-r--r-- | net-irc/eggdrop/files/eggdrop-installer | 120 |
1 files changed, 55 insertions, 65 deletions
diff --git a/net-irc/eggdrop/files/eggdrop-installer b/net-irc/eggdrop/files/eggdrop-installer index 9f6d3a47c7d6..0f57c493d177 100644 --- a/net-irc/eggdrop/files/eggdrop-installer +++ b/net-irc/eggdrop/files/eggdrop-installer @@ -1,94 +1,84 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/eggdrop/files/eggdrop-installer,v 1.6 2004/07/05 01:29:28 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-irc/eggdrop/files/eggdrop-installer,v 1.7 2004/09/12 03:27:05 swegener Exp $ source /etc/init.d/functions.sh || { - echo "$0: Could not source /etc/init.d/functions.sh!" - exit 1 + echo "${0}: Could not source /etc/init.d/functions.sh!" + exit 1 } # Checks to see if user is trying to install eggdrop as root. root_check() { + einfo "Installing Eggdrop" + einfo -echo "Installing Eggdrop" -if [ "$HOME" = "/root" ] || [ `whoami` == "root" ]; -then - einfo "You should not be installing eggdrop as root." - einfo "" - einfo "Installing eggdrop as root leaves your computer vulnerable" - einfo "to attack from other irc clients. Please use the eggdrop-installer" - einfo "script as the user who you wish to run eggdrop with" - exit 1 -else - install_eggdrop -fi - + if [ "${HOME}" = "/root" ] || [ "$(whoami)" == "root" ] + then + einfo "You should not be installing eggdrop as root." + einfo + einfo "Installing eggdrop as root leaves your computer vulnerable" + einfo "to attack from other irc clients. Please use the eggdrop-installer" + einfo "script as the user who you wish to run eggdrop with" + exit 1 + else + install_eggdrop + fi } # Usage information usage() { -cat << "USAGE_END" -Usage: eggbot-installer [bot-name] + cat <<USAGE_END +Usage: eggdrop-installer <bot-name> Install eggdrop for a specific user, creating the directories and files needed for eggdrop to run securely and safely. USAGE_END - -exit 1 + exit 1 } -install_eggdrop() -{ - if [ -e $HOME/.eggdrop/$bot_name ]; - then - einfo "Already found a bot home directory for $bot_name" - exit 1 - fi +install_eggdrop() { + bot_dir="${HOME}/.eggdrop/${bot_name}" - if [ ! -d $HOME/.eggdrop ] - then - mkdir -p $HOME/.eggdrop - fi - einfo "Creating directories for your $bot_name ..." - mkdir -p $HOME/.eggdrop/$bot_name - mkdir -p $HOME/.eggdrop/$bot_name/logs - mkdir -p $HOME/.eggdrop/$bot_name/filesys - mkdir -p $HOME/.eggdrop/$bot_name/filesys/incoming - mkdir -p $HOME/.eggdrop/$bot_name/text - mkdir -p $HOME/.eggdrop/$bot_name/tmp - mkdir -p $HOME/.eggdrop/$bot_name/scripts - # Added because of bug #3073 - mkdir -p $HOME/.eggdrop/$bot_name/var - + if [ -d "${bot_dir}" ] + then + einfo "Already found a bot home directory for ${bot_name}" + exit 1 + fi - einfo "Creating symlinks to required files for your bot to run ...." - ln -s /opt/eggdrop/help $HOME/.eggdrop/$bot_name/help - ln -s /opt/eggdrop/language $HOME/.eggdrop/$bot_name/language - ln -s /opt/eggdrop/modules $HOME/.eggdrop/$bot_name/modules - # Added because of bug #3073 - ln -s /opt/eggdrop/eggdrop $HOME/.eggdrop/$bot_name/eggdrop + einfo "Creating directories for your ${bot_name}..." + for dir in logs filesys/incoming text tmp scripts var + do + mkdir -p "${bot_dir}/${dir}" + done - einfo "Copying motd and banner ... " - cp /opt/eggdrop/text/* $HOME/.eggdrop/$bot_name/text + einfo "Creating symlinks to required files for your bot to run..." + for file in help language modules eggdrop + do + ln -s "/opt/eggdrop/${file}" "${bot_dir}/${file}" + done - # I changed this from a symlink to a direct copy because the user - # might not have write permissions to /opt/eggdrop/scripts - # as well as they might have their own custom scripts. - zul<chuck_short@rogers.com> - cp /opt/eggdrop/scripts/* $HOME/.eggdrop/$bot_name/scripts + einfo "Copying motd, banner, scripts and config file..." + cp /opt/eggdrop/text/* "${bot_dir}/text" + cp /opt/eggdrop/scripts/* "${bot_dir}/scripts" + cp /opt/eggdrop/eggdrop.conf "${bot_dir}/eggdrop.conf" - einfo "Finished..." - - einfo "Please edit your $HOME/.eggdrop/$bot_name/eggdrop.conf " - einfo "If you need any help pleaese refer to the man page, or " - einfo "eggdrop website at http://www.egghelper.org" - - cp /opt/eggdrop/eggdrop.conf $HOME/.eggdrop/$bot_name/eggdrop.conf + einfo "Finished..." + einfo + einfo "Please edit your ${bot_dir}/eggdrop.conf!" + einfo + einfo "The bot needs to be run from the ${bot_dir} directory." + einfo "Run 'cd ${bot_dir} && ./eggdrop -m eggdrop.conf'" + einfo "to create the user file and then remove the -m command line option" + einfo "to start your eggdrop bot." + einfo + einfo "If you need any help pleaese refer to the man page, or" + einfo "eggdrop website at http://www.egghelper.org" } -if [ ! -n "$1" ] +if [ ! -n "${1}" ] then - usage + usage else - bot_name="$1" - root_check + bot_name="${1}" + root_check fi |