Advertisement
AndrzejL

Upgrade_Eggdrop_Keep_UTF-8.sh

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