postinst is in clamav-unofficial-sigs 3.7.2-2.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/bin/sh
set -e
if [ "$1" = configure ] ; then
if [ -s /etc/clamav-unofficial-sigs.conf ] ; then
. /etc/clamav-unofficial-sigs.conf
fi
if [ "x$gpg_dir" = x ] ; then
gpg_dir=/var/lib/clamav-unofficial-sigs/gpg-key
fi
if [ ! -s "$gpg_dir/publickey.gpg" ] ; then
cp /usr/share/clamav-unofficial-sigs/publickey.gpg "$gpg_dir/publickey.gpg"
fi
# Detect which user the script will run from
# Will be 'clamav' unless the user customised the cron script
user="$(grep '^[^#]\+$' /etc/cron.d/clamav-unofficial-sigs | cut -d ' ' -f 6)"
if [ "x$user" != x -a "x$user" != xroot ] ; then
group="$(id -ng "$user")"
# Ensure the directories are all writable for the cron user
for dir in "$config_dir" "$ss_dir" "$msrbl_dir" "$si_dir" "$mbl_dir" "$add_dir"; do
if ! dpkg-statoverride --list "$dir" > /dev/null 2>&1 ; then
dpkg-statoverride --update --add "$user" "$group" 0755 "$dir"
chown -f "$user:$group" "$dir"/* > /dev/null 2>&1 || true
fi
done
if ! dpkg-statoverride --list "$gpg_dir" > /dev/null 2>&1 ; then
dpkg-statoverride --update --add "$user" "$group" 0700 "$gpg_dir"
chown -f "$user:$group" "$gpg_dir"/* > /dev/null 2>&1 || true
fi
# Create the log file and make it writable for the cron user
if [ ! -e "$log_file_path/$log_file_name" ] ; then
touch "$log_file_path/$log_file_name"
chown "$user:$group" "$log_file_path/$log_file_name"
fi
# Make all the files written by the script writable for the cron user on upgrade
if [ "x$2" != x ] && dpkg --compare-versions "$2" lt 3.5.4 ; then
for file in `cat "$config_dir/purge.txt" 2>/dev/null` ; do
chown -f "$user:$group" "$file" > /dev/null 2>&1 || true
done
fi
fi
fi
exit 0
|