Fix some bugs in the shell scripts.

This commit is contained in:
Adrian Pistol 2016-07-12 17:40:08 +02:00
parent e4d70d5147
commit 133d6eba32
No known key found for this signature in database
GPG key ID: 0AB17C4FEC11E631
3 changed files with 4 additions and 5 deletions

View file

@ -3,7 +3,7 @@
DATABASE=/tmp/docker-mailserver/postfix-accounts.cf DATABASE=/tmp/docker-mailserver/postfix-accounts.cf
function usage { function usage {
echo Usage: addmailuser <user@domain.tld> [password] echo 'Usage: addmailuser <user@domain.tld> [password]'
exit 1 exit 1
} }
@ -14,7 +14,7 @@ if [ ! -z "$1" ]; then
exit 1 exit 1
fi fi
if [ ! -z "$2" ]; then if [ ! -z "$2" ]; then
PASS=$2 PASS="$2"
else else
read -s -p "Enter Password: " PASS read -s -p "Enter Password: " PASS
if [ -z "$PASS" ]; then if [ -z "$PASS" ]; then
@ -22,7 +22,7 @@ if [ ! -z "$1" ]; then
exit 1 exit 1
fi fi
fi fi
ENTRY=$(echo "$USER|$(doveadm pw -s SHA512-CRYPT -u $USER -p $PASS)") ENTRY=$(echo "$USER|$(doveadm pw -s SHA512-CRYPT -u "$USER" -p "$PASS")")
echo "$ENTRY" >> $DATABASE echo "$ENTRY" >> $DATABASE
else else
usage usage

0
target/bin/generate-dkim-config Normal file → Executable file
View file

3
target/bin/generate-ssl-certificate Normal file → Executable file
View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
FQDN=$(hostname) FQDN=$(hostname --fqdn)
cd /ssl cd /ssl
# Create CA certificate # Create CA certificate
@ -11,4 +11,3 @@ openssl req -new -nodes -keyout /ssl/$FQDN-key.pem -out /ssl/$FQDN-req.pem -days
openssl ca -out /ssl/$FQDN-cert.pem -infiles /ssl/$FQDN-req.pem openssl ca -out /ssl/$FQDN-cert.pem -infiles /ssl/$FQDN-req.pem
# Combine certificates for courier # Combine certificates for courier
cat /ssl/$FQDN-key.pem /ssl/$FQDN-cert.pem > /ssl/$FQDN-combined.pem cat /ssl/$FQDN-key.pem /ssl/$FQDN-cert.pem > /ssl/$FQDN-combined.pem