-
Notifications
You must be signed in to change notification settings - Fork 1
/
entrypoint.sh
executable file
·56 lines (51 loc) · 1.55 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
set -e
if compgen -G "/config/rpm/*.rpm" > /dev/null; then
yum install -y /config/rpm/*.rpm || true
fi
if [ "$1" = "snmptrapd" ]; then
shift
cp /default/snmptrapd.conf /config/snmptrapd.conf
if [ -n "$TRAP_COMMUNITY_1" ] ; then
sed -r -i \
-e "s/^(.*) # TRAP_COMMUNITY_1/authCommunity execute,log $TRAP_COMMUNITY_1/" \
/config/snmptrapd.conf
fi
if [ -n "$TRAP_COMMUNITY_2" ] ; then
sed -r -i \
-e "s/^(.*) # TRAP_COMMUNITY_2$/authCommunity execute,log $TRAP_COMMUNITY_2/" \
/config/snmptrapd.conf
fi
if [ -n "$TRAP_COMMUNITY_3" ] ; then
sed -r -i \
-e "s/^(.*) # TRAP_COMMUNITY_3$/authCommunity execute,log $TRAP_COMMUNITY_3/" \
/config/snmptrapd.conf
fi
if [ -n "$TRAP_COMMUNITY_4" ] ; then
sed -r -i \
-e "s/^(.*) # TRAP_COMMUNITY_4$/authCommunity execute,log $TRAP_COMMUNITY_4/" \
/config/snmptrapd.conf
fi
if [ -n "$TRAP_COMMUNITY_5" ] ; then
sed -r -i \
-e "s/^(.*) # TRAP_COMMUNITY_5$/authCommunity execute,log $TRAP_COMMUNITY_5/" \
/config/snmptrapd.conf
fi
if [ -n "$TRAP_COMMUNITY_6" ] ; then
sed -r -i \
-e "s/^(.*) # TRAP_COMMUNITY_6$/authCommunity execute,log $TRAP_COMMUNITY_6/" \
/config/snmptrapd.conf
fi
if [ -n "$TRAP_COMMUNITY_7" ] ; then
sed -r -i \
-e "s/^(.*) # TRAP_COMMUNITY_7$/authCommunity execute,log $TRAP_COMMUNITY_7/" \
/config/snmptrapd.conf
fi
if [ -n "$TRAP_COMMUNITY_8" ] ; then
sed -r -i \
-e "s/^(.*) # TRAP_COMMUNITY_8$/authCommunity execute,log $TRAP_COMMUNITY_8/" \
/config/snmptrapd.conf
fi
exec /usr/sbin/snmptrapd -a -f -n -LE 5 "$@"
fi
exec "$@"