Skip to content

Instantly share code, notes, and snippets.

@isramv
Forked from v-jacob/Mailhog Bash Script (systemd)
Last active September 13, 2023 02:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save isramv/24814a881180ab58fdff9a14af9653df to your computer and use it in GitHub Desktop.
Save isramv/24814a881180ab58fdff9a14af9653df to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo ">>> Installing Mailhog"
# Download binary from github
wget --quiet -O ~/mailhog https://github.com/mailhog/MailHog/releases/download/v0.2.1/MailHog_linux_amd64
# Make it executable
chmod +x ~/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 /home/vagrant/mailhog > /dev/null 2>&1 &
[Install]
WantedBy=multi-user.target
EOL
# moving mailhog to init.d
`sudo mv ~/mailhog /etc/init.d/mailhog`
# updating service mailhog
`sudo update-rc.d mailhog defaults`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment