[Unit]
Description=imunify360-captchaserver-nginx - nginx-based captcha server for Imunify360
Documentation=https://docs.imunify360.com/
After=network-online.target remote-fs.target nss-lookup.target
Before=imunify360.service
Wants=network-online.target

[Service]
Type=forking
PIDFile=/var/run/imunify360-captchaserver-nginx.pid
ExecStartPre=/usr/share/imunify360/apply_user_customization
ExecStartPre=/bin/sh -c '/usr/share/imunify360/build_includes.py /usr/share/imunify360/captcha /usr/share/imunify360/captcha > /etc/imunify360/captcha/lang.conf'
ExecStartPre=/usr/share/imunify360/gen_ports_conf
ExecStartPre=/usr/sbin/imunify360-captchaserver-nginx -t -c /etc/imunify360/captcha/captcha.conf
ExecStart=/usr/sbin/imunify360-captchaserver-nginx -c /etc/imunify360/captcha/captcha.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID

[Install]
WantedBy=multi-user.target
