-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsit-inbox
executable file
·29 lines (28 loc) · 1.03 KB
/
sit-inbox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /usr/bin/env bash
case "$1" in
new)
mkdir -p "$2/etc"
mkdir -p "$2/targets"
mkdir -p "$2/.oldmail"
touch "$2/etc/config.toml"
touch "$2/.dockerargs"
echo "Edit $2/etc/config.toml to configure this instance"
;;
run)
if [ -z "$2" ]; then
echo "Usage: sit-inbox run <path> [command]"
exit 1
fi
docker_args=$(eval "echo $(cat "$(pwd)/$2/.dockerargs")")
docker run \
-v "$(pwd)/$2/etc:/etc/sit-inbox" \
-v "$(pwd)/$2/targets:/var/lib/targets" \
-v "$(pwd)/$2/.oldmail:/var/run/oldmail" \
${docker_args} \
-ti sit-inbox $3
;;
*)
echo "Usage: sit-inbox new [path]"
echo " sit-inbox run <path> [command]"
exit 1
esac