forked from mixman68/pbs-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
29 lines (24 loc) · 1018 Bytes
/
docker-entrypoint.sh
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
#!/bin/bash
set -e
#Fix perm (34 is backup)
chown -R 34:34 /etc/proxmox-backup
chmod -R 700 /etc/proxmox-backup
if [ -z $PBS_ADMIN_PASSWORD ]; then export PBS_ADMIN_PASSWORD=admin; fi
#Add a user
if [ ! -f /etc/proxmox-backup/user.cfg ]; then
proxmox-backup-manager user create admin@pbs --password $PBS_ADMIN_PASSWORD
proxmox-backup-manager acl update / Admin --auth-id admin@pbs
fi
#Build MSMTPRC File
if [ -z $MSMTP_HOST ]; then export MSMTP_HOST=localhost; fi
if [ -z $MSMTP_PORT ]; then export MSMTP_PORT=25; fi
if [ -z $MSMTP_TLS ]; then export MSMTP_TLS=off; fi
if [ -z $MSMTP_STARTTLS ]; then export MSMTP_STARTTLS=off; fi
if [ -z $MSMTP_TLSCHECK ]; then export MSMTP_TLSCHECK=off; fi
if [ -z $MSMTP_AUTH ]; then export MSMTP_AUTH=; fi
if [ -z $MSMTP_USER ]; then export MSMTP_USER=; fi
if [ -z $MSMTP_PASSWORD ]; then export MSMTP_PASSWORD=; fi
if [ -z $MSMTP_FROM ]; then export MSMTP_FROM=root@localhost; fi
cp /etc/msmtprc /tmp/msmtprc.env
envsubst < /tmp/msmtprc.env > /etc/msmtprc
exec "$@"