diff --git a/src/freedombone b/src/freedombone index 832fb646..4da2324b 100755 --- a/src/freedombone +++ b/src/freedombone @@ -1637,6 +1637,27 @@ function install_atheros_wifi { echo 'install_atheros_wifi' >> $COMPLETION_FILE } +function configure_avahi { + if grep -Fxq "configure_avahi" $COMPLETION_FILE; then + return + fi + # only enable avahi if we're doing mesh networking + if [[ $ENABLE_BABEL != "yes" && $ENABLE_BATMAN != "yes" && $ENABLE_CJDNS != "yes" ]]; then + return + fi + apt-get -y install avahi-utils avahi-autoipd + + if [ $DEFAULT_DOMAIN_NAME ]; then + sed -i "s|#host-name=.*|host-name=$DEFAULT_DOMAIN_NAME|g" /etc/avahi/avahi-daemon.conf + else + decarray=( 1 2 3 4 5 6 7 8 9 0 ) + PEER_ID=${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]}${decarray[$RANDOM%10]} + sed -i "s|#host-name=.*|host-name=freedombone-$PEER_ID|g" /etc/avahi/avahi-daemon.conf + fi + systemctl restart avahi-daemon + echo 'configure_avahi' >> $COMPLETION_FILE +} + function mesh_babel { if grep -Fxq "mesh_babel" $COMPLETION_FILE; then return @@ -1644,7 +1665,7 @@ function mesh_babel { if [[ $ENABLE_BABEL != "yes" ]]; then return fi - apt-get -y install babeld avahi-utils avahi-autoipd + apt-get -y install babeld numarray=( 1 2 3 4 5 6 7 8 9 0 ) a=${numarray[$RANDOM%2]}${numarray[$RANDOM%10]}${numarray[$RANDOM%10]} @@ -1678,7 +1699,7 @@ function mesh_batman_bridge { apt-get -y install iproute bridge-utils libnetfilter-conntrack3 batctl apt-get -y install python-dev libevent-dev ebtables python-pip git - apt-get -y install avahi-utils avahi-autoipd wireless-tools + apt-get -y install wireless-tools install_vpn_tunnel @@ -9851,6 +9872,7 @@ set_your_domain_name time_synchronisation configure_internet_protocol create_git_project +configure_avahi install_atheros_wifi mesh_cjdns mesh_cjdns_tools