Only install avahi on mesh startup

This commit is contained in:
Bob Mottram 2015-08-08 09:41:50 +01:00
parent e066ab1537
commit 0d9340dc75
1 changed files with 10 additions and 8 deletions

View File

@ -149,14 +149,16 @@ function mesh_batman {
echo '#!/bin/sh' > $batman_script echo '#!/bin/sh' > $batman_script
echo '' >> $batman_script echo '' >> $batman_script
echo '# install avahi' >> $batman_script echo 'if [[ $1 == "start" ]]; then' >> $batman_script
echo 'apt-get -y install avahi-utils avahi-autoipd' >> $batman_script echo ' # install avahi' >> $batman_script
echo 'sed -i "s|#host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $batman_script echo ' apt-get -y install avahi-utils avahi-autoipd' >> $batman_script
echo 'sed -i "s|host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $batman_script echo ' sed -i "s|#host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
echo 'if [ -f /bin/systemctl ]; then' >> $batman_script echo ' sed -i "s|host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
echo ' if [ -f /bin/systemctl ]; then' >> $batman_script
echo ' systemctl restart avahi-daemon' >> $batman_script echo ' systemctl restart avahi-daemon' >> $batman_script
echo 'else' >> $batman_script echo ' else' >> $batman_script
echo ' service avahi-daemon restart' >> $batman_script echo ' service avahi-daemon restart' >> $batman_script
echo ' fi' >> $batman_script
echo 'fi' >> $batman_script echo 'fi' >> $batman_script
echo '' >> $batman_script echo '' >> $batman_script
echo '# Mesh definition' >> $batman_script echo '# Mesh definition' >> $batman_script