#!/bin/sh # 2002-03-19 Rafael Skodlar # Create tar from compiled files in source directory # tar file includes install script on the server which needs to be executed and # README file with instructions # TODO: Install files from tar into final place VER=3.35 EXIM_SRC=$HOME/tmp/exim-${VER} BIN_DIR=$HOME/bin SCRIPT=${BIN_DIR}/exim-install RCSCRIPT=$HOME/bin/rc.exim EXIM_ETC=/etc/exim BIN_FILES="exim eximon eximon.bin exim_dumpdb exim_fixdb exim_tidydb exinext exiwhat exim_dbmbuild exicyclog exim_lock" UTIL_FILES="exigrep eximstats exiqsumm" TAR_DIR=/tmp/exim TAR=/tmp/exim-server-${VER}.tar function create_rc() { cat > $RCSCRIPT << EOM #!/bin/sh # # Exim Start/Stop # # chkconfig: 2345 80 30 # # description: Exim is a Mail Transport Agent # processname: exim # config: /etc/exim/exim.conf # pidfile: /var/run/exim.pid # 1999-12-10 Rafael Skodlar QUEUE=15m [ -f /usr/local/exim/bin/exim ] || exit 0 case "\$1" in start) # Start exim echo -n "Starting Exim: " /usr/local/exim/bin/exim -bd -q\$QUEUE ps ax|grep exim | grep -v status | grep -v grep ;; stop) # Stop daemons. echo -n "Shutting down exim: " killall exim rm /var/run/exim.pid* echo ;; restart) \$0 stop \$0 start ;; status) ps ax|grep exim | grep -v status | grep -v grep [ -f /var/run/exim.pid ] && (PID=\`cat /var/run/exim.pid*\`;echo "PID: \$PID") ;; *) echo "Usage: exim [start|stop|restart|status]" exit 1 esac exit 0 EOM } if [ ! -d "${TAR_DIR}" ]; then mkdir ${TAR_DIR} fi if [ -e "${RCSCRIPT}" ]; then cp ${RCSCRIPT} ${TAR_DIR} else echo "Creating rc script ${RCSCRIPT}!" create_rc fi if [ -e "${SCRIPT}" ]; then cp ${SCRIPT} ${TAR_DIR} else echo "Missing: ${SCRIPT}" fi cd ${EXIM_SRC} cp src/configure.default ${TAR_DIR}/exim.conf cd ${EXIM_SRC}/build-Linux-i386 cp ${BIN_FILES} ${TAR_DIR} cd ${EXIM_SRC}/util cp ${UTIL_FILES} ${TAR_DIR} cd /tmp cat > ${TAR_DIR}/README << EOM To install Exim on this machine do the following: cd ${TAR_DIR} ${TAR_DIR}/exim-install EOM cd /tmp tar cvf $TAR exim FSIZE=`ls -l $TAR | awk '{print $5 " " $9}'` echo "Tar file size: $FSIZE"