adchpp-docker/root/etc/service/adchpp/run
sneak 67833a1b2d
All checks were successful
continuous-integration/drone/push Build is passing
run as normal user, not root
2020-03-22 06:02:15 -07:00

25 lines
693 B
Bash

#!/bin/bash
if [[ ! -e /config/adchpp.xml ]]; then
cp /usr/local/src/adchpp/etc/adchpp.xml /config/adchpp.xml
fi
if [[ ! -d /config/scripts ]]; then
mkdir -p /config/scripts
cp /usr/local/src/adchpp/plugins/Script/examples/*.lua /config/scripts
fi
if [[ ! -d /config/certs ]]; then
mkdir -p /config/certs
cd /config/certs
bash /usr/local/src/adchpp/linux/generate_certs.sh
fi
if [[ ! -e /config/users.txt ]]; then
echo "[{\"password\":\"$DEFAULT_ADMIN_PASSWORD\",\"nick\":\"admin\",\"level\":10,\"regby\":\"admin\",\"regtime\":1322835912}]" > /config/users.txt
fi
chown -R user:user /config
cd /config
exec chpst -u user:user /usr/local/bin/adchppd -c /config