forked from ArtalkJS/Artalk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·26 lines (24 loc) · 1.04 KB
/
docker-entrypoint.sh
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
#!/bin/bash
set -e
if [ "$1" != 'gen' ] && ( [ ! -e /data/artalk.yml ] && [ ! -e /data/artalk-go.yml ] ); then
if [ -e /conf.yml ]; then
# Move original config to `/data/` for upgrade (<= v2.1.8)
cp /conf.yml /data/artalk.yml
upMsg=""
upMsg+=$'# [v2.1.9+ Updated]\n'
upMsg+=$'# The new version of the Artalk container recommends mounting\n'
upMsg+=$'# an entire folder instead of a single file to avoid some issues.\n'
upMsg+=$'#\n'
upMsg+=$'# The original config file has been moved to the "/data/" folder,\n'
upMsg+=$'# please unmount the config file volume from your container\n'
upMsg+=$'# and edit "/data/artalk.yml" for configuration.'
echo "$upMsg" > /conf.yml
echo "$(date) [info] Copy config file from '/conf.yml' to '/data/artalk.yml' for upgrade"
else
# Generate new config
artalk gen conf /data/artalk.yml
echo "$(date) [info] Generate new config file to '/data/artalk.yml'"
fi
fi
# Run Artalk
/usr/bin/artalk "$@"