#!/bin/bash

mkdir /home/stalwart
cd /home/stalwart
git init
git pull https://github.com/stalwartlabs/stalwart.git

cargo build

mkdir /etc/stalwart
mv /home/stalwart/resources/config/config.toml /etc/stalwart

mv /home/stalwart/target/debug/stalwart /usr/bin
mv /home/stalwart/target/debug/stalwart-cli /usr/bin

rm -r /home/stalwart