feat: init
This commit is contained in:
25
config/dns/entrypoint.sh
Executable file
25
config/dns/entrypoint.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -d "/app/conf" ]; then
|
||||
mkdir /app/conf
|
||||
fi
|
||||
|
||||
if [ ! -f "/app/conf/config.json" ]; then
|
||||
cp /conf/config.sample.json /app/conf/config.json
|
||||
elif [ "/conf/config.sample.json" -nt "/app/conf/config.json" ]; then
|
||||
echo "example config file is newer than existing config."
|
||||
echo "replacing existing file by new config"
|
||||
|
||||
CONFIG_BACKUP="/app/conf/config_$(date +"%Y%m%d_%H%M%s").json"
|
||||
|
||||
echo "saving existing config as ${CONFIG_BACKUP}"
|
||||
|
||||
cp /app/conf/config.json ${CONFIG_BACKUP}
|
||||
cp /conf/config.sample.json /app/conf/config.json
|
||||
fi
|
||||
|
||||
if [ -z "$@" ] ; then
|
||||
exec "/app/dns-proxy-server" -XX:MaxHeapSize=50m -XX:MaxNewSize=10m
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
Reference in New Issue
Block a user