Skip to content

Instantly share code, notes, and snippets.

@dayroned
Created July 18, 2020 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dayroned/f8db968fbf6149595a2050f64c59727b to your computer and use it in GitHub Desktop.
Save dayroned/f8db968fbf6149595a2050f64c59727b to your computer and use it in GitHub Desktop.
#!/bin/bash
echo ">>> Installing Mailhog"
# Download binary from github
wget --quiet -O /tmp/mailhog https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
# Move binary to /opt
sudo mv /tmp/mailhog /opt/mailhog
# Make it executable
chmod +x /opt/mailhog
# Make it start on reboot
sudo tee /etc/systemd/system/mailhog.service <<EOL
[Unit]
Description=MailHog Service
After=network.service vagrant.mount
[Service]
Type=simple
ExecStart=/usr/bin/env /opt/mailhog > /dev/null 2>&1 &
[Install]
WantedBy=multi-user.target
EOL
# Start on reboot
sudo systemctl enable mailhog
# Start background service now
sudo systemctl start mailhog
# Adapted from: https://gist.github.com/varghesejacob/c31a844042ca5ced6b72ccab3cd6055b
# 2020.04.01-DEA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment