Only install avahi on mesh startup

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

View File

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