Base file

This is all that remains of the V1 script after superfluous code has been removed and minor code tweaks made.
master
basilhendroff 2020-05-21 04:57:33 +08:00 committed by GitHub
parent d88f6ec203
commit ea7717d6c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 22 deletions

23
caddy
View File

@ -27,28 +27,7 @@ load_rc_config ${name}
: ${caddy_bin_path="/usr/local/bin/caddy"}
: ${caddy_config_path="/usr/local/www/Caddyfile"}
if [ "$caddy_cert_email" = "" ]
then
echo "rc variable \$caddy_cert_email is not set. Please provide a valid SSL certificate issuer email."
exit 1
fi
pidfile="/var/run/${name}.pid"
procname="${caddy_bin_path}" #enabled builtin pid checking for start / stop
command="/usr/sbin/daemon"
command_args="-p ${pidfile} -T ${name} -l ${caddy_syslog_facility} -s ${caddy_syslog_level} /usr/bin/env ${caddy_env} ${procname} ${caddy_options} < /dev/null"
start_precmd="caddy_startprecmd"
caddy_startprecmd()
{
# Clear flags provided by caddy_flags to prevent them being passed to daemon(8)
rc_flags=""
if [ ! -e "${pidfile}" ]; then
install -o "${caddy_user}" -g "${caddy_group}" "/dev/null" "${pidfile}"
fi
}
command="${caddy_bin_path}"
required_files="${caddy_config_path}"