Skip to content

Commit

Permalink
Updated script output to be a bit more informative
Browse files Browse the repository at this point in the history
  • Loading branch information
tedivm committed Jan 20, 2014
1 parent 81afac3 commit 3bf6434
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
13 changes: 6 additions & 7 deletions SetupEnvironment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ -n "$TRAVIS" ]; then

echo 'Travis config not yet written'
echo 'Starting Travis Provisioning'

if [ ! -d "$DIR/resources" ]; then
DIR="$( dirname $(find ./ -name 'SetupEnvironment.sh') )"
DIR="$( dirname $(find $TRAVIS_BUILD_DIR -name '.dovecottestingmark') )"
fi

if [ ! -d "$DIR/resources" ]; then
DIR="$( dirname $(find $TRAVIS_BUILD_DIR -name 'SetupEnvironment.sh') )"
fi

sudo cp -Rp $DIR/resources /resources
sudo /bin/bash /resources/Scripts/Provision.sh
sudo /bin/bash /resources/Scripts/SSL.sh
Expand All @@ -27,6 +22,8 @@ else

# Since not in travis, lets load up a system with vagrant

echo 'Starting Vagrant Provisioning'

cd $DIR/vagrant

VAGRANTSTATUS=$(vagrant status)
Expand All @@ -39,4 +36,6 @@ else
fi
cd $DIR

fi
fi

echo 'Environment has finished being setup'
13 changes: 9 additions & 4 deletions resources/Scripts/Provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ else
sudo echo 'disable_plaintext_auth = no' >> /etc/dovecot/local.conf
sudo echo 'mail_max_userip_connections = 10000' >> /etc/dovecot/local.conf
sudo restart dovecot
echo 'Dovecot has been installed'
fi


Expand All @@ -22,15 +23,19 @@ fi
if getent passwd testuser > /dev/null; then
echo 'testuser already exists'
else
echo 'Creating User "testuser"'
echo 'Creating User "testuser" with password "applesauce"'
sudo useradd testuser -m -s /bin/bash
echo "testuser:applesauce"|sudo chpasswd
echo "testuser:applesauce" | sudo chpasswd
echo 'User created'
fi


# Setup Email

/bin/bash /resources/Scripts/ResetMail.sh


echo 'Environment has been provisioned'
echo ''
echo ''
echo 'Dovecot has been provisioned with the test mailbox.'
echo ''
echo ''
2 changes: 1 addition & 1 deletion resources/Scripts/ResetMail.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

echo 'Refreshing the test mailbox- this could take a minute.'
echo 'Refreshing the test mailbox.'

sudo stop dovecot
[ -d "/home/testuser/Maildir" ] && sudo rm -R /home/testuser/Maildir
Expand Down

0 comments on commit 3bf6434

Please sign in to comment.