-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockbert
executable file
·77 lines (67 loc) · 1.85 KB
/
dockbert
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
#
# Start / Stop the dockbert "traefik" service
#
echo '______ _ _ _'
echo '| _ \ | | | | | |'
echo '| | | |___ ___| | _| |__ ___ _ __| |_'
echo '| | | / _ \ / __| |/ / '_ \ / _ \ '__| __|'
echo '| |/ / (_) | (__| <| |_) | __/ | | |_'
echo '|___/ \___/ \___|_|\_\_.__/ \___|_| \__|'
echo ' '
COMMAND="${1:-help}"
#
# Check the file "dockbert.env"
#
DOCKBERT_ENV=${HOME}/dockbert.env
if [ -f "${DOCKBERT_ENV}" ]; then
echo "[info] Found dockbert.env and use it ..."
source ${DOCKBERT_ENV}
fi
if [ "${COMMAND}" != "help" ]; then
MISSING=0
if [[ -z "${DOCKBERT_DOMAIN}" ]]; then
echo "[Error] missing the environment 'DOCKBERT_DOMAIN'"
MISSING=1
fi;
if [[ -z "${DOCKBERT_USERS_FILE}" ]]; then
echo "[Error] missing the environment 'DOCKBERT_USERS_FILE'"
MISSING=1
fi;
if [[ -z "${DOCKBERT_ACME_EMAIL}" ]]; then
echo "[Error] missing the environment 'DOCKBERT_ACME_EMAIL'"
MISSING=1
fi;
if [[ -z "${DOCKBERT_ACME_PATH}" ]]; then
echo "[Error] missing the environment 'DOCKBERT_ACME_PATH'"
MISSING=1
fi;
if [ ${MISSING} = 1 ]; then
exit 1;
fi
fi
case $COMMAND in
'debug')
echo "[info] start the dockbert traefik. Stop with Crl+C"
docker-compose up
;;
'start')
echo "[info] start dockbert traefik in background"
docker-compose up -d
;;
'stop')
echo "[info] stop the dockbert traefik"
docker-compose down
;;
'help')
echo ''
echo '> Start / Stop the dockbert "traefik" service'
echo ''
echo '> Usage:'
echo ' dockbert (start|stop|debug)'
echo ''
echo ' "start" start the dockbert traefik in the background'
echo ' "stop" stop the dockbert traefik'
echo ' "debug" start the dockbert traefik. Stop with Crl+C'
;;
esac