formations/cesi/securite_entreprise/ressources/intranet-demo/provisioning/supervision/configure_fakesmtp.sh

31 lines
505 B
Bash

#!/usr/bin/env bash
set -xe
apt-get update
apt-get install -y nodejs nodejs-legacy git npm
mkdir -p /opt
cd /opt
git clone https://github.com/Bornholm/faketools.git faketools
cd faketools
npm install --production
cat > /etc/systemd/system/fakesmtp.service <<EOF
[Unit]
Description=FakeSMTP Server
After=network-online.target
[Service]
Type=simple
ExecStart=/opt/faketools/bin/fake-smtp
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl enable fakesmtp
systemctl start fakesmtp