Ticket #835: patch_awstats_logrotate.sh

File patch_awstats_logrotate.sh, 402 bytes (added by dominiquearpin, 1 year ago)
Line 
1 #!/bin/bash
2 #Patch for Bug #835
3 #by dominiquearpin
4 for j in apache apache2
5 do
6         $(which grep) \/usr\/share\/awstats\/tools\/awstats_updateall\.pl /etc/logrotate.d/$j
7         if [ $? == 1 ];then
8                 sed -i 's/postrotate/postrotate\n\t\/usr\/share\/awstats\/tools\/awstats_updateall\.pl\ now -awstatsprog=\/usr\/lib\/cgi-bin\/awstats\/awstats\.pl/g' /etc/logrotate.d/$j
9         else
10                 echo "patch already done"
11         fi
12 done
13