浏览代码

Fix crontab entries for restarting avahi-daemon

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

+ 1
- 1
src/freedombone 查看文件

@@ -1705,7 +1705,7 @@ function configure_avahi {
1705 1705
   # this is a blatant hack, but I couldn't find a better way of mitigating the problem
1706 1706
   # of avahi-daemon stopping after a few minutes
1707 1707
   if ! grep -q "avahi-daemon" /etc/crontab; then
1708
-      echo '1 * * * *   root    systemctl restart avahi-daemon > /dev/null' >> /etc/crontab
1708
+      echo '* *\t* * *\troot\tsystemctl restart avahi-daemon > /dev/null' >> /etc/crontab
1709 1709
   fi
1710 1710
 
1711 1711
   echo 'configure_avahi' >> $COMPLETION_FILE

+ 4
- 4
src/freedombone-client 查看文件

@@ -120,9 +120,9 @@ function mesh_babel {
120 120
   echo '    sed -i "s|host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $babel_script
121 121
   echo '    if ! grep -q "avahi-daemon" /etc/crontab; then' >> $babel_script
122 122
   echo '        if [ -f /bin/systemctl ]; then' >> $babel_script
123
-  echo "            echo '1 *   * * *   root    systemctl restart avahi-daemon > /dev/null' >> /etc/crontab" >> $babel_script
123
+  echo "            echo '* *\t* * *\troot\tsystemctl restart avahi-daemon > /dev/null' >> /etc/crontab" >> $babel_script
124 124
   echo '        else' >> $babel_script
125
-  echo "            echo '1 *   * * *   root    service avahi-daemon restart > /dev/null' >> /etc/crontab" >> $babel_script
125
+  echo "            echo '* *\t* * *\troot\tservice avahi-daemon restart > /dev/null' >> /etc/crontab" >> $babel_script
126 126
   echo '        fi' >> $babel_script
127 127
   echo '    fi' >> $babel_script
128 128
   echo '    if [ -f /bin/systemctl ]; then' >> $babel_script
@@ -204,9 +204,9 @@ function mesh_batman {
204 204
   echo '    sed -i "s|hosts:.*|hosts:          files mdns4_minimal dns mdns4 mdns|g" /etc/nsswitch.conf' >> $batman_script
205 205
   echo '    if ! grep -q "avahi-daemon" /etc/crontab; then' >> $batman_script
206 206
   echo '        if [ -f /bin/systemctl ]; then' >> $batman_script
207
-  echo "            echo '1 *   * * *   root    systemctl restart avahi-daemon > /dev/null' >> /etc/crontab" >> $batman_script
207
+  echo "            echo '* *\t* * *\troot\tsystemctl restart avahi-daemon > /dev/null' >> /etc/crontab" >> $batman_script
208 208
   echo '        else' >> $batman_script
209
-  echo "            echo '1 *   * * *   root    service avahi-daemon restart > /dev/null' >> /etc/crontab" >> $batman_script
209
+  echo "            echo '* *\t* * *\troot\tservice avahi-daemon restart > /dev/null' >> /etc/crontab" >> $batman_script
210 210
   echo '        fi' >> $batman_script
211 211
   echo '    fi' >> $batman_script
212 212
   echo 'fi' >> $batman_script