Began work on emailing service #1456

This commit is contained in:
Torkel Ödegaard
2015-06-04 14:29:39 +02:00
parent 83279604c6
commit 3f5ab189cd
9 changed files with 334 additions and 0 deletions

27
docker/blocks/smtp/bootstrap.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
set -u
# User params
USER_PARAMS=$@
# Internal params
RUN_CMD="snmpd -f ${USER_PARAMS}"
#######################################
# Echo/log function
# Arguments:
# String: value to log
#######################################
log() {
if [[ "$@" ]]; then echo "[`date +'%Y-%m-%d %T'`] $@";
else echo; fi
}
# Launch
log $RUN_CMD
$RUN_CMD
# Exit immidiately in case of any errors or when we have interactive terminal
if [[ $? != 0 ]] || test -t 0; then exit $?; fi
log