Skip to content

Commit

Permalink
Revert "drop Mailpit feature (#1933)" (#1973)
Browse files Browse the repository at this point in the history
This reverts commit d14da1f.
  • Loading branch information
svpernova09 committed Apr 29, 2024
1 parent e466c30 commit 98a798b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions scripts/features/mailpit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

if [ -f ~/.homestead-features/wsl_user_name ]; then
WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)"
WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)"
else
WSL_USER_NAME=vagrant
WSL_USER_GROUP=vagrant
fi

export DEBIAN_FRONTEND=noninteractive

if [ -f /home/$WSL_USER_NAME/.homestead-features/mailpit ]
then
echo "mailpit already installed."
exit 0
fi

touch /home/$WSL_USER_NAME/.homestead-features/mailpit
chown -Rf $WSL_USER_NAME:$WSL_USER_GROUP /home/$WSL_USER_NAME/.homestead-features

curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh | sh

chown -f $WSL_USER_NAME:$WSL_USER_GROUP /usr/local/bin/mailpit

cat > /etc/systemd/system/mailpit.service << EOF
[Unit]
Description=Mailpit
After=network.target
[Service]
User=vagrant
ExecStart=/usr/bin/env /usr/local/bin/mailpit
[Install]
WantedBy=multi-user.target
EOF

systemctl disable --now mailpit

systemctl enable --now mailpit

0 comments on commit 98a798b

Please sign in to comment.