AndrzejL

Upgrade_Eggdrop_Ver_1.1_Keep_UTF-8.sh at work

Mar 10th, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. #
  3. # Script written by AndrzejL. Sed lines by Enlik.
  4. #
  5. # I assume that:
  6. #
  7. # - You have a brain. ;)
  8. # - The brain belongs to You. :D
  9. # - You know how to use Your brain. ;D
  10. # - You have installed all the eggdrop's dependencies.
  11. # - You have installed and configured eggdrop 1.8 and it sits in ~/eggdrop folder. (1)
  12. # - You want / need UTF-8 support.
  13. # - You want to automate the process of upgrading the bot without a fuss.
  14. #
  15. # Script is partially based on http://eggwiki.org/Utf-8
  16. #
  17. # Script is intended to be run as a non-root user.
  18. #
  19. # Want to see how the script works? http://pastebin.com/97H4P7CE
  20. #
  21. # Script's purpose: upgrade Eggdrop 1.8 and ensure the use of the UTF-8 in 17 easy steps:
  22. #
  23. # 01 Switch to user's ~ folder.
  24. # 02 Remove user's ~/.ccache to assure clean compilation.
  25. # 03 Remove previous snapshot archive from user's ~ if there is one.
  26. # 04 Remove previous compilation folder from user's ~ if there is one.
  27. # 05 Download latest eggdrop-develop snapshot tarball directly to user's ~ folder.
  28. # 06 Extract tarball to ~/eggdrop-develop folder.
  29. # 07 Modify (thanks to Enlik) file ~/eggdrop-develop/src/main.h to ensure UTF-8 support.
  30. # 08 Modify (thanks to Enlik) file ~/eggdrop-develop/src/tcl.c to ensure UTF-8 support.
  31. # 09 Enter the ~/eggdrop-develop folder.
  32. # 10 Run ./configure.
  33. # 11 Run make config.
  34. # 12 Run make static.
  35. # 13 Run make install.
  36. # 14 Kill currently running eggdrop process.
  37. # 15 Switch to ~/eggdrop folder
  38. # 16 Wait 10 seconds.
  39. # 17 Start the bot again.
  40. #
  41. # Script is documented and commented while it runs with echo prints.
  42. # You will notice that all the comments are in blue on a white background.
  43. # You will notice that after each step a command "date" is invoked
  44. # this way You can check how long did it took from the start of the script
  45. # to the moment that the job is done. Some of You may find it useful.
  46. #
  47. # (1) As a side note: script _can_ be used to install fresh copy of eggdrop 1.8
  48. # however the bot will not start until it's properly configured.
  49. # For more info about configuring / troubleshooting eggdrop visit: http://eggwiki.org/
  50. # or #eggdrop IRC channel on Freenode. This can be done using browser:
  51. # http://webchat.freenode.net/?channels=eggdrop&uio=ND10cnVlJjEyPXRydWU91
  52. # or IRC client of Your choice.
  53. #
  54. # I am not an eggdrop expert thus I am not willing / able to provide support for it.
  55. #
  56. # This script is shared with You under Creative Commons Attribution - ShareAlike license.
  57. # More information about the license visit http://creativecommons.org/licenses/by-sa/3.0/
  58. #
  59. # This script is distributed in the hope that it will be useful,
  60. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  61. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  62. #
  63.  
  64. echo -e '\E[37;44m'"\033[1mScript at work? http://pastebin.com/97H4P7CE\033[0m"
  65. date &&
  66. cd ~ &&
  67. date &&
  68. echo -e '\E[37;44m'"\033[1mChanged to ~.\033[0m"
  69. date &&
  70. rm -Rf ~/.ccache/ &&
  71. date &&
  72. echo -e '\E[37;44m'"\033[1mRemoved ~/.ccache to asure clean compilation.\033[0m"
  73. date &&
  74. rm -Rf ~/eggdrop1.8-snapshot.tar.gz &&
  75. date &&
  76. echo -e '\E[37;44m'"\033[1mRemoved previous snapshot archive.\033[0m"
  77. date &&
  78. rm -Rf ~/eggdrop-develop &&
  79. date &&
  80. echo -e '\E[37;44m'"\033[1mRemoved previous compilation folder.\033[0m"
  81. date &&
  82. echo -e '\E[37;44m'"\033[1mDownloading latest eggdrop-develop snapshot tarball.\033[0m"
  83. date &&
  84. wget -c ftp://ftp.eggheads.org/pub/eggdrop/source/snapshot/eggdrop1.8-snapshot.tar.gz &&
  85. date &&
  86. echo -e '\E[37;44m'"\033[1mDownloading finished.\033[0m"
  87. date &&
  88. echo -e '\E[37;44m'"\033[1mExtracting tarbal.\033[0m"
  89. date &&
  90. tar -zxvf ~/eggdrop1.8-snapshot.tar.gz &&
  91. date &&
  92. echo -e '\E[37;44m'"\033[1mTarball extracted.\033[0m"
  93. date &&
  94. # sed commands by Enlik
  95. 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"
  96. date &&
  97. sed -i 's/^# define USE_TCL_BYTE_ARRAYS/# undef USE_TCL_BYTE_ARRAYS/' ~/eggdrop-develop/src/main.h &&
  98. date &&
  99. sed -i '/^\s*encoding = "iso8859-1";/aencoding = "utf-8";' ~/eggdrop-develop/src/tcl.c &&
  100. date &&
  101. cd ~/eggdrop-develop &&
  102. date &&
  103. echo -e '\E[37;44m'"\033[1mMoved to the compilation folder.\033[0m"
  104. date &&
  105. echo -e '\E[37;44m'"\033[1m./configure.\033[0m"
  106. date &&
  107. ./configure --with-tcllib='/usr/lib/libtcl8.6.so' --with-tclinc='/usr/include/tcl.h'&&
  108. date &&
  109. echo -e '\E[37;44m'"\033[1mmake config.\033[0m"
  110. date &&
  111. make config &&
  112. date &&
  113. echo -e '\E[37;44m'"\033[1mmake static.\033[0m"
  114. date &&
  115. make static &&
  116. date &&
  117. echo -e '\E[37;44m'"\033[1mmake install.\033[0m"
  118. date &&
  119. make install &&
  120. date &&
  121. echo -e '\E[37;44m'"\033[1mKilling bot.\033[0m"
  122. date &&
  123. killall eggdrop &&
  124. date &&
  125. echo -e '\E[37;44m'"\033[1mWaiting 10 seconds.\033[0m"
  126. date &&
  127. sleep 10 &&
  128. echo -e '\E[37;44m'"\033[1mResurecting bot.\033[0m"
  129. date &&
  130. bot
Advertisement
Add Comment
Please, Sign In to add comment