Zionetrix::Git
Repositories
Help
Report an Issue
mantisbt-smtp-gateway
Code
Commits
Branches
Tags
Search
Tree:
bcb5fe7
Branches
Tags
master
mantisbt-smtp-gateway
install.sh
install.sh : added python-html2text dependency
Benjamin Renard
commited
bcb5fe7
at 2012-04-20 16:07:44
install.sh
Blame
History
Raw
#!/bin/bash cd $( dirname $0 ) dir=$( pwd ) files=" /etc/mantis-smtp.conf /etc/init.d/mantis-smtp /usr/bin/mantis-smtp /usr/share/mantis-smtp " function install_file() { from=$1 dst=$2 if [ -e "$dst" ] then echo -e "\t- backuping $file in ${file}.old" mv $dst $dst.old fi echo -e "\t- $file" ln -s "$from" "$dst" } case "$1" in install-req) echo "Install requirements :" if [ -f /usr/bin/apt-get ] then apt-get install python-suds python-simplejson python-html2text elif [ -x /usr/bin/yum ] then yum install python-suds python-simplejson python-html2text else echo "Can't package manager." exit 1 fi ;; install) $0 install-req echo "Files installation :" for file in $files do install_file ${dir}/src${file} ${file} done if [ -f /etc/redhat-release ] then install_file ${dir}/src/etc/default/mantis-smtp /etc/sysconfig/mantis-smtp elif [ -f /etc/debian_version ] then install_file ${dir}/src/etc/default/mantis-smtp /etc/default/mantis-smtp fi echo done. ;; uninstall) echo "Uninstalling files :" for file in $files /etc/sysconfig/mantis-smtp /etc/default/mantis-smtp do [ ! -e $file ] && continue echo -e "\t- Uninstall file $file :" rm -rf "$file" done echo done. ;; *) echo "Usage : $0 {install|install-req|uninstall}" esac