~ubuntu-branches/ubuntu/maverick/clamav/maverick-backports

« back to all changes in this revision

Viewing changes to debian/clamav-freshclam.postinst.in

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran, Stephen Gran, Michael Tautschnig
  • Date: 2010-04-26 21:41:18 UTC
  • mfrom: (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100426214118-i6lo606wnh7ywfj6
Tags: 0.96+dfsg-4
[ Stephen Gran ]
* Fixed typo in clamav-milter's postinst

[ Michael Tautschnig ]
* Fixed typo in clamav-freshclam's postinst (closes: #579271)
* Debconf translation updates
  - Portuguese (closes: #579068)

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
  fi
92
92
  db_metaget clamav-freshclam/NotifyClamd value || true
93
93
  [ "$RET" = "true" ] && notify="/etc/clamav/clamd.conf"
 
94
  db_metaget clamav-base/Bytecode value || true
 
95
  bytecode="$RET"
94
96
 
95
97
  slurp_config "$FRESHCLAMCONFFILE"
96
98
 
98
100
  [ -n "$DatabaseOwner" ] && [ "$DatabaseOwner" != "$dbowner" ] && dbowner="$DatabaseOwner"
99
101
  [ -n "$UpdateLogFile" ] && [ "$UpdateLogFile" != "$udlogfile" ] && udlogfile="$UpdateLogFile"
100
102
  [ -n "$MaxAttempts" ] && [ "$MaxAttempts" != "$maxatt" ] && maxatt="$MaxAttempts"
 
103
  [ -n "$Bytecode" ] && [ "$Bytecode" != "$bytecode" ] && bytecode="$Bytecode"
 
104
 
 
105
  if [ -n "$udlogfile" ]; then
 
106
    if echo "$udlogfile" | grep -q '^/dev/'; then
 
107
      make_logrotate=false
 
108
    else
 
109
      make_logrotate=true
 
110
    fi
 
111
    [ -n "$User" ] || User=clamav
 
112
    if [ "$make_logrotate" = 'true' ]; then
 
113
      echo "$udlogfile {" > $DEBROTFILE
 
114
      echo "     rotate 12" >> $DEBROTFILE
 
115
      echo "     weekly" >> $DEBROTFILE
 
116
      echo "     compress" >> $DEBROTFILE
 
117
      echo "     delaycompress" >> $DEBROTFILE
 
118
      echo "     missingok" >> $DEBROTFILE
 
119
      echo "     create 640  $User adm" >> $DEBROTFILE
 
120
      echo "     postrotate" >> $DEBROTFILE
 
121
      echo "     /etc/init.d/clamav-freshclam reload-log > /dev/null" >> $DEBROTFILE
 
122
      echo "     endscript" >> $DEBROTFILE
 
123
      echo "     }" >> $DEBROTFILE
 
124
      touch "$udlogfile"
 
125
      chown "$User":adm "$udlogfile"
 
126
      chmod 0640 "$udlogfile"
 
127
      ucf_cleanup "$LOGROTFILE"
 
128
      ucf_upgrade_check "$LOGROTFILE" "$DEBROTFILE" /var/lib/ucf/cache/:etc:logrotate.d:clamav-freshclam
 
129
      rm -f $DEBROTFILE
 
130
    else
 
131
      if [ -e "$LOGROTFILE" ]; then
 
132
        echo "Disabling old logrotate script for clamav-freshclam"
 
133
        mv "$LOGROTFILE" "$CLAMAVROTATEFILE".dpkg-old
 
134
        ucf -p "$LOGROTFILE"
 
135
      fi
 
136
    fi
 
137
  else
 
138
    if [ -e "$LOGROTFILE" ]; then
 
139
      echo "Disabling old logrotate script for clamav-freshclam"
 
140
      mv "$LOGROTFILE" "$CLAMAVROTATEFILE".dpkg-old
 
141
      ucf -p "$LOGROTFILE"
 
142
    fi
 
143
  fi
101
144
 
102
145
  # Set up cron method
103
146
  if [ "$runas" = cron ]; then
140
183
  [ -z "$ConnectTimeout" ] && ConnectTimeout=30
141
184
  [ -z "$ReceiveTimeout" ] && ReceiveTimeout=30
142
185
  [ -z "$ScriptedUpdates" ] && ScriptedUpdates=yes
143
 
  [ -z "$LogTime" ] && LogTime=no
 
186
  [ -z "$LogTime" ] && LogTime=true
144
187
  [ -z "$CompressLocalDatabase" ] && CompressLocalDatabase=no
145
188
 
146
189
  # Generate config file
166
209
ReceiveTimeout $ReceiveTimeout
167
210
ScriptedUpdates $ScriptedUpdates
168
211
CompressLocalDatabase $CompressLocalDatabase
 
212
Bytecode $bytecode
169
213
EOF
170
214
 
171
215
  if [ -n "$notify" ] ;then
212
256
  [ -n "$LocalIPAddress" ] && echo "LocalIPAddress $LocalIPAddress" >> $DEBCONFILE
213
257
  [ -n "$SubmitDetectionStats" ] && echo "SubmitDetectionStats $SubmitDetectionStats" >> $DEBCONFILE
214
258
  [ -n "$DetectionStatsCountry" ] && echo "DetectionStatsCountry $DetectionStatsCountry" >> $DEBCONFILE
 
259
  [ -n "$DetectionStatsHostID" ] && echo "DetectionStatsHostID $DetectionStatsHostID" >> $DEBCONFILE
215
260
  [ -n "$SafeBrowsing" ] && echo "SafeBrowsing $SafeBrowsing" >> $DEBCONFILE
216
261
  
217
262
  ucf_cleanup "$FRESHCLAMCONFFILE"