Selaa lähdekoodia

Configure avahi on regular client installs

Bob Mottram 8 vuotta sitten
vanhempi
commit
1b72fc896d
1 muutettua tiedostoa jossa 11 lisäystä ja 6 poistoa
  1. 11
    6
      src/freedombone-client

+ 11
- 6
src/freedombone-client Näytä tiedosto

@@ -267,6 +267,16 @@ function remove_known_hosts_entries {
267 267
     fi
268 268
 }
269 269
 
270
+function setup_avahi_client {
271
+    echo $'Configuring Avahi'
272
+    if [ ! -f /usr/bin/pacman ]; then
273
+        sudo apt-get -yq install avahi-utils avahi-autoipd avahi-dnsconfd
274
+    else
275
+        sudo pacman -S --noconfirm avahi nss-mdns
276
+        sudo sed -i 's|hosts:.*|hosts: files mdns_minimal [NOTFOUND=return] dns myhostname|g' /etc/nsswitch.conf
277
+    fi
278
+}
279
+
270 280
 while [[ $# > 1 ]]
271 281
 do
272 282
     key="$1"
@@ -303,6 +313,7 @@ do
303 313
 done
304 314
 
305 315
 echo $'Configuring client'
316
+setup_avahi_client
306 317
 setup_client_app
307 318
 refresh_gpg_keys
308 319
 configure_ssh_client
@@ -311,12 +322,6 @@ configure_monkeysphere
311 322
 remove_known_hosts_entries
312 323
 if [[ $MESH_CLIENT_INSTALL == $'yes' || $MESH_CLIENT_INSTALL == $'y' || $MESH_CLIENT_INSTALL == $'on' ]]; then
313 324
     echo $'Installing mesh packages'
314
-    if [ ! -f /usr/bin/pacman ]; then
315
-        sudo apt-get -yq install avahi-utils avahi-autoipd avahi-dnsconfd
316
-    else
317
-        sudo pacman -S --noconfirm avahi nss-mdns
318
-        sudo sed -i 's|hosts:.*|hosts: files mdns_minimal [NOTFOUND=return] dns myhostname|g' /etc/nsswitch.conf
319
-    fi
320 325
     sudo ${PROJECT_NAME}-mesh-install -f tox_node
321 326
     sudo ${PROJECT_NAME}-mesh-install -f toxic
322 327
     ${PROJECT_NAME}-mesh-install -f qtox