Zionetrix::Git
Repositories
Help
Report an Issue
mantisbt-smtp-gateway
Code
Commits
Branches
Tags
Search
Tree:
a875b96
Branches
Tags
master
mantisbt-smtp-gateway
install.sh
Initial commit
Benjamin Renard
commited
a875b96
at 2011-11-24 16:55:40
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 elif [ -x /usr/bin/yum ] then yum install python-suds python-simplejson 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