瀏覽代碼

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
   # this is a blatant hack, but I couldn't find a better way of mitigating the problem
1705
   # this is a blatant hack, but I couldn't find a better way of mitigating the problem
1706
   # of avahi-daemon stopping after a few minutes
1706
   # of avahi-daemon stopping after a few minutes
1707
   if ! grep -q "avahi-daemon" /etc/crontab; then
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
   fi
1709
   fi
1710
 
1710
 
1711
   echo 'configure_avahi' >> $COMPLETION_FILE
1711
   echo 'configure_avahi' >> $COMPLETION_FILE

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

120
   echo '    sed -i "s|host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $babel_script
120
   echo '    sed -i "s|host-name=.*|host-name=$(hostname)|g" /etc/avahi/avahi-daemon.conf' >> $babel_script
121
   echo '    if ! grep -q "avahi-daemon" /etc/crontab; then' >> $babel_script
121
   echo '    if ! grep -q "avahi-daemon" /etc/crontab; then' >> $babel_script
122
   echo '        if [ -f /bin/systemctl ]; then' >> $babel_script
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
   echo '        else' >> $babel_script
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
   echo '        fi' >> $babel_script
126
   echo '        fi' >> $babel_script
127
   echo '    fi' >> $babel_script
127
   echo '    fi' >> $babel_script
128
   echo '    if [ -f /bin/systemctl ]; then' >> $babel_script
128
   echo '    if [ -f /bin/systemctl ]; then' >> $babel_script
204
   echo '    sed -i "s|hosts:.*|hosts:          files mdns4_minimal dns mdns4 mdns|g" /etc/nsswitch.conf' >> $batman_script
204
   echo '    sed -i "s|hosts:.*|hosts:          files mdns4_minimal dns mdns4 mdns|g" /etc/nsswitch.conf' >> $batman_script
205
   echo '    if ! grep -q "avahi-daemon" /etc/crontab; then' >> $batman_script
205
   echo '    if ! grep -q "avahi-daemon" /etc/crontab; then' >> $batman_script
206
   echo '        if [ -f /bin/systemctl ]; then' >> $batman_script
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
   echo '        else' >> $batman_script
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
   echo '        fi' >> $batman_script
210
   echo '        fi' >> $batman_script
211
   echo '    fi' >> $batman_script
211
   echo '    fi' >> $batman_script
212
   echo 'fi' >> $batman_script
212
   echo 'fi' >> $batman_script