From bbcc172b5c8da90f1c96bd0e7bf6ca6d74e85d28 Mon Sep 17 00:00:00 2001 From: Alexander <7adietri@users.noreply.github.com> Date: Fri, 10 Aug 2018 20:45:48 +0200 Subject: [PATCH] Add rc.local Install cloud IPv4 forwarding rule and snmpd from rc.local, if necessary. --- Richtfunk/bb-fux-kern/etc/rc.local | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Richtfunk/bb-fux-kern/etc/rc.local diff --git a/Richtfunk/bb-fux-kern/etc/rc.local b/Richtfunk/bb-fux-kern/etc/rc.local new file mode 100644 index 0000000..5d42c24 --- /dev/null +++ b/Richtfunk/bb-fux-kern/etc/rc.local @@ -0,0 +1,21 @@ +# Put your custom commands here that should be executed once +# the system init finished. By default this file does nothing. + +CLOUD_IPV4=/lib/gluon/ebtables/109-local-forward-allow-cloud +if [ ! -f $CLOUD_IPV4 ]; then + echo "Installing cloud IPv4 rule" + echo "rule('LOCAL_FORWARD -p IPv4 --ip-src 193.96.224.238/32 -j RETURN')" > $CLOUD_IPV4 + /etc/init.d/gluon-ebtables start $CLOUD_IPV4 +else + echo "Cloud IPv4 rule already exists" +fi + +HAS_SNMPD=$(opkg list-installed | grep ^snmpd | wc -l) +if [ $HAS_SNMPD -eq 0 ]; then + echo "Installing snmpd" + opkg update && opkg install snmpd +else + echo "snmpd already installed" +fi + +exit 0