diff options
Diffstat (limited to 'meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh')
-rwxr-xr-x | meta-iot/recipes-connectivity/avahi/avahi-daemon-init/avahi-daemon-init-settings.sh | 20 |
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 | |||
3 | KERNEL_VERSION=`uname -r | cut -d . -f 1-2` | ||
4 | MAJOR=`echo $KERNEL_VERSION | cut -d . -f 1` | ||
5 | MINOR=`echo $KERNEL_VERSION | cut -d . -f 2` | ||
6 | |||
7 | if [ "${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 | ||
17 | fi | ||
18 | |||
19 | exit 0 | ||
20 | |||