Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # Script written by AndrzejL. Sed lines by Enlik.
- #
- # I assume that:
- #
- # - You have a brain. ;)
- # - The brain belongs to You. :D
- # - You know how to use Your brain. ;D
- # - You have installed all the eggdrop's dependencies.
- # - You have installed and configured eggdrop 1.8 and it sits in ~/eggdrop folder. (1)
- # - You want / need UTF-8 support.
- # - You want to automate the process of upgrading the bot without a fuss.
- #
- # Script is partially based on http://eggwiki.org/Utf-8
- #
- # Script is intended to be run as a non-root user.
- #
- # Want to see how the script works? http://pastebin.com/97H4P7CE
- #
- # Script's purpose: upgrade Eggdrop 1.8 and ensure the use of the UTF-8 in 17 easy steps:
- #
- # 01 Switch to user's ~ folder.
- # 02 Remove user's ~/.ccache to assure clean compilation.
- # 03 Remove previous snapshot archive from user's ~ if there is one.
- # 04 Remove previous compilation folder from user's ~ if there is one.
- # 05 Download latest eggdrop-develop snapshot tarball directly to user's ~ folder.
- # 06 Extract tarball to ~/eggdrop-develop folder.
- # 07 Modify (thanks to Enlik) file ~/eggdrop-develop/src/main.h to ensure UTF-8 support.
- # 08 Modify (thanks to Enlik) file ~/eggdrop-develop/src/tcl.c to ensure UTF-8 support.
- # 09 Enter the ~/eggdrop-develop folder.
- # 10 Run ./configure.
- # 11 Run make config.
- # 12 Run make static.
- # 13 Run make install.
- # 14 Kill currently running eggdrop process.
- # 15 Switch to ~/eggdrop folder
- # 16 Wait 10 seconds.
- # 17 Start the bot again.
- #
- # Script is documented and commented while it runs with echo prints.
- # You will notice that all the comments are in blue on a white background.
- # You will notice that after each step a command "date" is invoked
- # this way You can check how long did it took from the start of the script
- # to the moment that the job is done. Some of You may find it useful.
- #
- # (1) As a side note: script _can_ be used to install fresh copy of eggdrop 1.8
- # however the bot will not start until it's properly configured.
- # For more info about configuring / troubleshooting eggdrop visit: http://eggwiki.org/
- # or #eggdrop IRC channel on Freenode. This can be done using browser:
- # http://webchat.freenode.net/?channels=eggdrop&uio=ND10cnVlJjEyPXRydWU91
- # or IRC client of Your choice.
- #
- # I am not an eggdrop expert thus I am not willing / able to provide support for it.
- #
- # This script is shared with You under Creative Commons Attribution - ShareAlike license.
- # More information about the license visit http://creativecommons.org/licenses/by-sa/3.0/
- #
- # This script is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- #
- echo -e '\E[37;44m'"\033[1mScript at work? http://pastebin.com/97H4P7CE\033[0m"
- date &&
- cd ~ &&
- date &&
- echo -e '\E[37;44m'"\033[1mChanged to ~.\033[0m"
- date &&
- rm -Rf ~/.ccache/ &&
- date &&
- echo -e '\E[37;44m'"\033[1mRemoved ~/.ccache to asure clean compilation.\033[0m"
- date &&
- rm -Rf ~/eggdrop1.8-snapshot.tar.gz &&
- date &&
- echo -e '\E[37;44m'"\033[1mRemoved previous snapshot archive.\033[0m"
- date &&
- rm -Rf ~/eggdrop-develop &&
- date &&
- echo -e '\E[37;44m'"\033[1mRemoved previous compilation folder.\033[0m"
- date &&
- echo -e '\E[37;44m'"\033[1mDownloading latest eggdrop-develop snapshot tarball.\033[0m"
- date &&
- wget -c ftp://ftp.eggheads.org/pub/eggdrop/source/snapshot/eggdrop1.8-snapshot.tar.gz &&
- date &&
- echo -e '\E[37;44m'"\033[1mDownloading finished.\033[0m"
- date &&
- echo -e '\E[37;44m'"\033[1mExtracting tarbal.\033[0m"
- date &&
- tar -zxvf ~/eggdrop1.8-snapshot.tar.gz &&
- date &&
- echo -e '\E[37;44m'"\033[1mTarball extracted.\033[0m"
- date &&
- # sed commands by Enlik
- echo -e '\E[37;44m'"\033[1mModyfying files main.h and tcl.c files to gain UTF-8 support. Thanks for the commands Enlik!\033[0m"
- date &&
- sed -i 's/^# define USE_TCL_BYTE_ARRAYS/# undef USE_TCL_BYTE_ARRAYS/' ~/eggdrop-develop/src/main.h &&
- date &&
- sed -i '/^\s*encoding = "iso8859-1";/aencoding = "utf-8";' ~/eggdrop-develop/src/tcl.c &&
- date &&
- cd ~/eggdrop-develop &&
- date &&
- echo -e '\E[37;44m'"\033[1mMoved to the compilation folder.\033[0m"
- date &&
- echo -e '\E[37;44m'"\033[1m./configure.\033[0m"
- date &&
- ./configure --with-tcllib='/usr/lib/libtcl8.6.so' --with-tclinc='/usr/include/tcl.h'&&
- date &&
- echo -e '\E[37;44m'"\033[1mmake config.\033[0m"
- date &&
- make config &&
- date &&
- echo -e '\E[37;44m'"\033[1mmake static.\033[0m"
- date &&
- make static &&
- date &&
- echo -e '\E[37;44m'"\033[1mmake install.\033[0m"
- date &&
- make install &&
- date &&
- echo -e '\E[37;44m'"\033[1mKilling bot.\033[0m"
- date &&
- killall eggdrop &&
- date &&
- echo -e '\E[37;44m'"\033[1mWaiting 10 seconds.\033[0m"
- date &&
- sleep 10 &&
- echo -e '\E[37;44m'"\033[1mResurecting bot.\033[0m"
- date &&
- bot
Advertisement
Add Comment
Please, Sign In to add comment