-
Notifications
You must be signed in to change notification settings - Fork 0
/
customize
executable file
·49 lines (36 loc) · 1.15 KB
/
customize
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
#!/usr/bin/bash
#
# Put customizations to your image in this file.
PATH=/opt/local/gnu/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin
# Munin plugins
MUNIN_PLUGINS="
dovecot
redis_replication_status
"
# Exit if any commands fail
set -o errexit
# Configuring image specific packages
echo "* Configuring image specific packages.";
echo "* Remove mailx lock dir"
rm -rf /var/mail/\:saved/
echo "* Remove all examples dovecot configuration"
shopt -s extglob
rm -f /opt/local/etc/dovecot/conf.d/!(core-*)
rm -f /opt/local/etc/dovecot/*.ext
rm -f /opt/local/etc/dovecot/dovecot-example.conf
echo "* Allow dovecot user access to redis"
usermod -G redis dovecot
echo "* Install dovecot auth daemon"
npm install -g dovecot-core-authd
svccfg import /opt/local/lib/node_modules/dovecot-core-authd/manifest.xml
echo "* Create ssl folder"
mkdir -p /opt/local/etc/dovecot/ssl
echo "* Create log folder for dovecot"
mkdir -p /var/log/dovecot
echo "* Activate munin plugins"
/opt/core/bin/munin-node-plugins ${MUNIN_PLUGINS}
echo "* Cleanup home/admin because of delegate dataset usage"
rm -rf /home/admin/.[^.]*
echo "* Cleaning up"
rm -rf /root/*
sm-prepare-image -y