+

Last commit for install.sh: bcb5fe71979922871dca19d20c5001caf1d57b29

install.sh : added python-html2text dependency

Benjamin Renard [2012-04-20 16:07:44]
install.sh : added python-html2text dependency
  1. #!/bin/bash
  2.  
  3. cd $( dirname $0 )
  4. dir=$( pwd )
  5.  
  6. files="
  7. /etc/mantis-smtp.conf
  8. /etc/init.d/mantis-smtp
  9. /usr/bin/mantis-smtp
  10. /usr/share/mantis-smtp
  11. "
  12.  
  13. function install_file() {
  14. from=$1
  15. dst=$2
  16. if [ -e "$dst" ]
  17. then
  18. echo -e "\t- backuping $file in ${file}.old"
  19. mv $dst $dst.old
  20. fi
  21. echo -e "\t- $file"
  22. ln -s "$from" "$dst"
  23. }
  24.  
  25.  
  26. case "$1" in
  27. install-req)
  28. echo "Install requirements :"
  29.  
  30. if [ -f /usr/bin/apt-get ]
  31. then
  32. apt-get install python-suds python-simplejson python-html2text
  33. elif [ -x /usr/bin/yum ]
  34. then
  35. yum install python-suds python-simplejson python-html2text
  36. else
  37. echo "Can't package manager."
  38. exit 1
  39. fi
  40.  
  41. ;;
  42. install)
  43. $0 install-req
  44.  
  45. echo "Files installation :"
  46.  
  47. for file in $files
  48. do
  49. install_file ${dir}/src${file} ${file}
  50. done
  51. if [ -f /etc/redhat-release ]
  52. then
  53. install_file ${dir}/src/etc/default/mantis-smtp /etc/sysconfig/mantis-smtp
  54. elif [ -f /etc/debian_version ]
  55. then
  56. install_file ${dir}/src/etc/default/mantis-smtp /etc/default/mantis-smtp
  57. fi
  58.  
  59. echo done.
  60. ;;
  61. uninstall)
  62. echo "Uninstalling files :"
  63. for file in $files /etc/sysconfig/mantis-smtp /etc/default/mantis-smtp
  64. do
  65. [ ! -e $file ] && continue
  66. echo -e "\t- Uninstall file $file :"
  67. rm -rf "$file"
  68. done
  69.  
  70. echo done.
  71. ;;
  72. *)
  73. echo "Usage : $0 {install|install-req|uninstall}"
  74. esac