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
+13
View File
@@ -0,0 +1,13 @@
FROM centos:centos7
MAINTAINER Przemyslaw Ozgo <linux@ozgo.info>
RUN \
yum update -y && \
yum install -y net-snmp net-snmp-utils && \
yum clean all
COPY bootstrap.sh /tmp/bootstrap.sh
EXPOSE 161
ENTRYPOINT ["/tmp/bootstrap.sh"]
+27
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
+4
View File
@@ -0,0 +1,4 @@
snmpd:
build: blocks/snmpd
ports:
- "161:161"