浏览代码

Restart the avahi daemon at the end of start

Bob Mottram 9 年前
父节点
当前提交
1dfd0e65a0
共有 2 个文件被更改,包括 12 次插入5 次删除
  1. 6
    0
      src/freedombone
  2. 6
    5
      src/freedombone-client

+ 6
- 0
src/freedombone 查看文件

1833
   echo '        brctl addif $BRIDGE $EIFACE' >> $batman_script
1833
   echo '        brctl addif $BRIDGE $EIFACE' >> $batman_script
1834
   echo '        ifconfig $BRIDGE up' >> $batman_script
1834
   echo '        ifconfig $BRIDGE up' >> $batman_script
1835
   echo '    fi' >> $batman_script
1835
   echo '    fi' >> $batman_script
1836
+  echo '' >> $batman_script
1837
+  echo '    if [ -f /bin/systemctl ]; then' >> $batman_script
1838
+  echo '        systemctl restart avahi-daemon' >> $batman_script
1839
+  echo '    else' >> $batman_script
1840
+  echo '        service avahi-daemon restart' >> $batman_script
1841
+  echo '    fi' >> $batman_script
1836
   echo '}' >> $batman_script
1842
   echo '}' >> $batman_script
1837
   echo '' >> $batman_script
1843
   echo '' >> $batman_script
1838
   echo 'stop() {' >> $batman_script
1844
   echo 'stop() {' >> $batman_script

+ 6
- 5
src/freedombone-client 查看文件

167
   echo '    apt-get -y install avahi-utils avahi-autoipd' >> $batman_script
167
   echo '    apt-get -y install avahi-utils avahi-autoipd' >> $batman_script
168
   echo '    sed -i "s|#host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
168
   echo '    sed -i "s|#host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
169
   echo '    sed -i "s|host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
169
   echo '    sed -i "s|host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $batman_script
170
-  echo '    if [ -f /bin/systemctl ]; then' >> $batman_script
171
-  echo '        systemctl restart avahi-daemon' >> $batman_script
172
-  echo '    else' >> $batman_script
173
-  echo '        service avahi-daemon restart' >> $batman_script
174
-  echo '    fi' >> $batman_script
175
   echo 'fi' >> $batman_script
170
   echo 'fi' >> $batman_script
176
   echo '' >> $batman_script
171
   echo '' >> $batman_script
177
   echo '# Mesh definition' >> $batman_script
172
   echo '# Mesh definition' >> $batman_script
240
   echo '        brctl addif $BRIDGE $EIFACE' >> $batman_script
235
   echo '        brctl addif $BRIDGE $EIFACE' >> $batman_script
241
   echo '        ifconfig $BRIDGE up' >> $batman_script
236
   echo '        ifconfig $BRIDGE up' >> $batman_script
242
   echo '    fi' >> $batman_script
237
   echo '    fi' >> $batman_script
238
+  echo '' >> $batman_script
239
+  echo '    if [ -f /bin/systemctl ]; then' >> $batman_script
240
+  echo '        systemctl restart avahi-daemon' >> $batman_script
241
+  echo '    else' >> $batman_script
242
+  echo '        service avahi-daemon restart' >> $batman_script
243
+  echo '    fi' >> $batman_script
243
   echo '}' >> $batman_script
244
   echo '}' >> $batman_script
244
   echo '' >> $batman_script
245
   echo '' >> $batman_script
245
   echo 'stop() {' >> $batman_script
246
   echo 'stop() {' >> $batman_script