Install avahi within mesh scripts

This commit is contained in:
Bob Mottram 2015-08-08 09:28:40 +01:00
parent c3053c4c6f
commit b99e6b5b14
1 changed files with 21 additions and 0 deletions

View File

@ -94,6 +94,17 @@ function mesh_babel {
babel_script=/tmp/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 'fi' >> $babel_script
echo '' >> $babel_script
echo 'IFACE=wlan0' >> $babel_script
echo 'IFACE_EXISTS=$(grep "$IFACE" /proc/net/dev)' >> $babel_script
echo '' >> $babel_script
@ -138,6 +149,16 @@ function mesh_batman {
echo '#!/bin/sh' > $batman_script
echo '' >> $batman_script
echo '# install avahi' >> $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 ' systemctl restart avahi-daemon' >> $batman_script
echo 'else' >> $batman_script
echo ' service avahi-daemon restart' >> $batman_script
echo 'fi' >> $batman_script
echo '' >> $batman_script
echo '# Mesh definition' >> $batman_script
echo "ESSID=$ESSID" >> $batman_script
echo "CELLID=$BATMAN_CELLID" >> $batman_script