Skip to content

Commit

Permalink
Merged the ResetMail and Provision scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tedivm committed Jan 20, 2014
1 parent 3bf6434 commit f591995
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
25 changes: 18 additions & 7 deletions resources/Scripts/Provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ echo 'Provisioning Environment with Dovecot and Test Messages'

# Install and Configure Dovecot

if which dovecot > /dev/null; then
if which dovecot > /dev/null; then
echo 'Dovecot is already installed'
else
else
echo 'Installing Dovecot'
sudo apt-get -qq -y install dovecot-imapd dovecot-pop3d
sudo touch /etc/dovecot/local.conf
Expand All @@ -15,24 +15,35 @@ else
sudo echo 'mail_max_userip_connections = 10000' >> /etc/dovecot/local.conf
sudo restart dovecot
echo 'Dovecot has been installed'
fi
fi


# Create "testuser"

if getent passwd testuser > /dev/null; then
if getent passwd testuser > /dev/null; then
echo 'testuser already exists'
else
else
echo 'Creating User "testuser" with password "applesauce"'
sudo useradd testuser -m -s /bin/bash
echo "testuser:applesauce" | sudo chpasswd
echo 'User created'
fi
fi


# Setup Email

/bin/bash /resources/Scripts/ResetMail.sh
echo 'Refreshing the test mailbox.'

sudo stop dovecot
[ -d "/home/testuser/Maildir" ] && sudo rm -R /home/testuser/Maildir
sudo cp -Rp /resources/Maildir /home/testuser/
sudo chown -R testuser:testuser /home/testuser/Maildir
sudo start dovecot

echo 'Test mailbox restored'.


# Done!

echo ''
echo ''
Expand Down
11 changes: 0 additions & 11 deletions resources/Scripts/ResetMail.sh

This file was deleted.

0 comments on commit f591995

Please sign in to comment.