Forked from v-jacob/Mailhog Bash Script (systemd)
Last active
September 13, 2023 02:54
-
-
Save isramv/24814a881180ab58fdff9a14af9653df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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