-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostinst
More file actions
45 lines (39 loc) · 1.67 KB
/
postinst
File metadata and controls
45 lines (39 loc) · 1.67 KB
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
#! /bin/sh
mkdir -p /var/log/sendmailwrapper || exit 1
chmod a+wx /var/log/sendmailwrapper || exit 2
chmod a+r /var/log || exit 3
# Deal with the pwdblacklist->directoryblacklist switch
if [ -f /etc/sendmailwrapper/pwdblacklist ]; then
if [ -f /etc/sendmailwrapper/directoryblacklist ]; then
echo "pwdblacklist and directoryblacklist both exist; merging into directoryblacklist"
cat /etc/sendmailwrapper/pwdblacklist >> /etc/sendmailwrapper/directoryblacklist
rm /etc/sendmailwrapper/pwdblacklist;
else
echo "old pwdblacklist found; moving to /etc/sendmailwrapper/directoryblacklist"
mv /etc/sendmailwrapper/pwdblacklist /etc/sendmailwrapper/directoryblacklist
fi
fi
# Create a munin plugin
if [ -d /etc/munin/plugins ]; then
if [ -f /etc/munin/plugins/sendmailwrapper ]; then
echo "Failed to create munin plugin; file /etc/munin/plugins/sendmailwrapper already exists";
echo "Carrying on with package installation";
else
echo "Creating munin plugin"
sendmailwrapper-stats --munin-create-plugin > /etc/munin/plugins/sendmailwrapper
/etc/init.d/munin-node restart
fi
fi
# Create example blacklist files, with comments
if [ ! -f /etc/sendmailwrapper/directoryblacklist ]; then
echo "#/tmp" > /etc/sendmailwrapper/directoryblacklist
fi
if [ ! -f /etc/sendmailwrapper/scriptblacklist ]; then
echo "#eval\(\)'d" > /etc/sendmailwrapper/scriptblacklist
fi
if [ ! -f /etc/sendmailwrapper/combinationblacklist ]; then
echo "#/tmp spam.php" > /etc/sendmailwrapper/combinationblacklist
fi
if [ ! -f /etc/sendmailwrapper/recipientblacklist ]; then
echo "#bill@microsoft.com" > /etc/sendmailwrapper/recipientblacklist
fi