Use ipv4 with avahi

This commit is contained in:
Bob Mottram 2015-08-09 12:15:59 +01:00
parent d71d04beca
commit b95e3d4cc7
2 changed files with 14 additions and 7 deletions

View File

@ -1660,7 +1660,7 @@ function configure_avahi {
# remove an avahi service which isn't used
if [ -f /etc/avahi/services/udisks.service ]; then
rm /etc/avahi/services/udisks.service
rm /etc/avahi/services/udisks.service
fi
systemctl restart avahi-daemon
@ -1688,6 +1688,9 @@ function mesh_babel {
echo 'if [[ $1 == "start" ]]; then' >> $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 ' sed -i "s|use-ipv4=.*|use-ipv4=yes|g" /etc/avahi/avahi-daemon.conf' >> $babel_script
echo ' sed -i "s|use-ipv6=.*|use-ipv6=no|g" /etc/avahi/avahi-daemon.conf' >> $babel_script
echo ' sed -i "s|hosts:.*|hosts: files mdns4_minimal [NOTFOUND=return] dns $(hostname)|g" /etc/nsswitch.conf' >> $babel_script
echo ' if [ -f /bin/systemctl ]; then' >> $babel_script
echo ' systemctl restart avahi-daemon' >> $babel_script
echo ' else' >> $babel_script
@ -1804,6 +1807,8 @@ function mesh_batman_bridge {
echo ' echo "error: unable to find wifi interface, not enabling batman-adv mesh"' >> $batman_script
echo ' return' >> $batman_script
echo ' fi' >> $batman_script
echo ' sed -i "s|use-ipv4=.*|use-ipv4=yes|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
echo ' sed -i "s|use-ipv6=.*|use-ipv6=no|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
echo ' sed -i "s|hosts:.*|hosts: files mdns4_minimal [NOTFOUND=return] dns $(hostname)|g" /etc/nsswitch.conf' >> $batman_script
echo ' echo "info: enabling batman-adv mesh network $ESSID on $IFACE"' >> $batman_script
echo ' systemctl stop network-manager' >> $batman_script

View File

@ -60,26 +60,26 @@ function configure_ssh_client {
sudo sed -i "s/# MACs.*/ MACs $SSH_MACS/g" /etc/ssh/ssh_config
if ! grep -q "HostKeyAlgorithms" /etc/ssh/ssh_config; then
sudo cp /etc/ssh/ssh_config ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
echo " HostKeyAlgorithms $SSH_HOST_KEY_ALGORITHMS" >> ~/ssh_config
sudo mv ~/ssh_config /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
fi
sudo sed -i "s/Ciphers.*/Ciphers $SSH_CIPHERS/g" /etc/ssh/ssh_config
if ! grep -q "Ciphers " /etc/ssh/ssh_config; then
sudo cp /etc/ssh/ssh_config ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
echo " Ciphers $SSH_CIPHERS" >> ~/ssh_config
sudo mv ~/ssh_config /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
fi
sudo sed -i "s/MACs.*/MACs $SSH_MACS/g" /etc/ssh/ssh_config
if ! grep -q "MACs " /etc/ssh/ssh_config; then
sudo cp /etc/ssh/ssh_config ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
sudo chown $CURR_USER:$CURR_USER ~/ssh_config
echo " MACs $SSH_MACS" >> ~/ssh_config
sudo mv ~/ssh_config /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
sudo chown root:root /etc/ssh/ssh_config
fi
# Create ssh keys
@ -179,6 +179,8 @@ function mesh_batman {
echo ' apt-get -y install avahi-utils avahi-autoipd avahi-daemon avahi-dnsconfd' >> $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 ' sed -i "s|use-ipv4=.*|use-ipv4=yes|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
echo ' sed -i "s|use-ipv6=.*|use-ipv6=no|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
echo ' sed -i "s|hosts:.*|hosts: files mdns4_minimal [NOTFOUND=return] dns $(hostname)|g" /etc/nsswitch.conf' >> $batman_script
echo 'fi' >> $batman_script
echo '' >> $batman_script