adchpp-docker/root/etc/service/adchpp/run

25 lines
693 B
Plaintext
Raw Permalink Normal View History

2020-03-22 09:02:04 +00:00
#!/bin/bash
2020-03-22 10:26:16 +00:00
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
2020-03-22 12:51:17 +00:00
if [[ ! -e /config/users.txt ]]; then
echo "[{\"password\":\"$DEFAULT_ADMIN_PASSWORD\",\"nick\":\"admin\",\"level\":10,\"regby\":\"admin\",\"regtime\":1322835912}]" > /config/users.txt
fi
2020-03-22 13:02:15 +00:00
chown -R user:user /config
cd /config
2020-03-22 13:02:15 +00:00
exec chpst -u user:user /usr/local/bin/adchppd -c /config