Explorar el Código

Tidy avahi utils

Bob Mottram hace 7 años
padre
commit
bcf377b9cd
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3
    3
      src/freedombone-utils-avahi

+ 3
- 3
src/freedombone-utils-avahi Ver fichero

@@ -57,6 +57,7 @@ function create_avahi_service {
57 57
 }
58 58
 
59 59
 function mesh_avahi {
60
+    # shellcheck disable=SC2154
60 61
     chroot "$rootdir" apt-get -yq install avahi-utils avahi-dnsconfd
61 62
 
62 63
     decarray=( 1 2 3 4 5 6 7 8 9 0 )
@@ -126,13 +127,12 @@ function install_avahi {
126 127
         return
127 128
     fi
128 129
 
129
-    ${PROJECT_NAME}-mesh-install -f avahi
130
-    if [ ! "$?" = "0" ]; then
130
+    if ! "${PROJECT_NAME}-mesh-install" -f avahi; then
131 131
         echo $'Failed to install avahi'
132 132
         exit 68442
133 133
     fi
134 134
 
135
-    if [ $DEFAULT_DOMAIN_NAME ]; then
135
+    if [ "$DEFAULT_DOMAIN_NAME" ]; then
136 136
         sed -i "s|#host-name=.*|host-name=$LOCAL_NAME|g" /etc/avahi/avahi-daemon.conf
137 137
         sed -i "s|host-name=.*|host-name=$LOCAL_NAME|g" /etc/avahi/avahi-daemon.conf
138 138
     else