summaryrefslogtreecommitdiffstats
path: root/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh')
-rwxr-xr-xmeta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh
new file mode 100755
index 0000000..3a12e9c
--- /dev/null
+++ b/meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3KERNEL_VERSION=`uname -r | cut -d . -f 1-2`
4MAJOR=`echo $KERNEL_VERSION | cut -d . -f 1`
5MINOR=`echo $KERNEL_VERSION | cut -d . -f 2`
6
7if [ "${MAJOR}.`printf '%02d' $MINOR`" \< "3.09" ]; then
8 # avahi might not start because SO_REUSEPORT might be missing during
9 # runtime. The symbol is only available from kernel 3.9 onwards.
10 AVAHI_CONF=/etc/avahi/avahi-daemon.conf
11 if [ -f $AVAHI_CONF ]; then
12 sed -i -e "s|^#disallow-other-stacks=.*|disallow-other-stacks=yes|" $AVAHI_CONF
13 else
14 echo "[server]" > $AVAHI_CONF
15 echo "disallow-other-stacks=yes" >> $AVAHI_CONF
16 fi
17fi
18
19exit 0
20