j'ai refait le script par rapport aux autres modèles
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2619|4|2615|5|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/337//ansiblelint">Evolix » ansible-roles » unstable #337</a>
gitea/ansible-roles/pipeline/head This commit looks good
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2619|4|2615|5|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/337//ansiblelint">Evolix » ansible-roles » unstable #337</a>
gitea/ansible-roles/pipeline/head This commit looks good
This commit is contained in:
parent
a440110cad
commit
e289fd7119
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
readonly PROGNAME=$(basename "$0")
|
|
||||||
readonly ARGS=$@
|
|
||||||
|
|
||||||
readonly VERBOSE=${VERBOSE:-"0"}
|
|
||||||
readonly QUIET=${QUIET:-"0"}
|
|
||||||
|
|
||||||
error() {
|
error() {
|
||||||
>&2 echo "${PROGNAME}: $1"
|
>&2 echo "${PROGNAME}: $1"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -15,14 +9,36 @@ debug() {
|
||||||
>&2 echo "${PROGNAME}: $1"
|
>&2 echo "${PROGNAME}: $1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
daemon_found_and_running() {
|
||||||
if [ -n "$(pidof proftpd)" ]; then
|
test -n "$(pidof proftpd)" && test -n "${proftpd_bin}"
|
||||||
if $($(command -v proftpd) -t 2> /dev/null); then
|
}
|
||||||
debug "ProFTPD detected... reloading"
|
config_check() {
|
||||||
service proftpd reload
|
${proftpd_bin} configtest > /dev/null 2>&1
|
||||||
|
}
|
||||||
|
letsencrypt_used() {
|
||||||
|
grep -q -r -E "letsencrypt" /etc/proftpd/
|
||||||
|
}
|
||||||
|
main() {
|
||||||
|
if daemon_found_and_running; then
|
||||||
|
if letsencrypt_used; then
|
||||||
|
if config_check; then
|
||||||
|
debug "ProFTPD detected... reloading"
|
||||||
|
systemctl reload proftpd
|
||||||
|
else
|
||||||
|
error "ProFTPD config is broken, you must fix it !"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
debug "ProFTPD doesn't use Let's Encrypt certificate. Skip."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
error "ProFTPD config is broken, you must fix it !"
|
debug "ProFTPD is not running or missing. Skip."
|
||||||
fi
|
fi
|
||||||
else
|
}
|
||||||
debug "ProFTPD is not running. Skip."
|
|
||||||
fi
|
readonly PROGNAME=$(basename "$0")
|
||||||
|
readonly VERBOSE=${VERBOSE:-"0"}
|
||||||
|
readonly QUIET=${QUIET:-"0"}
|
||||||
|
|
||||||
|
readonly proftpd_bin=$(command -v proftpd)
|
||||||
|
|
||||||
|
main
|
||||||
|
|
Loading…
Reference in a new issue