Use mdoc(7) instead of markdown #6

Merged
Ghost merged 27 commits from use-mdoc into master 2019-01-29 16:53:15 +01:00
3 changed files with 13 additions and 13 deletions
Showing only changes of commit c9dcca1a77 - Show all commits

View file

@ -22,6 +22,12 @@ trap "rm ${duc_output} ${incs_output} ${stat_output}" 0
"${DUC}" ls -d "${IDX_FILE}" "${JAILDIR}" > "${duc_output}"
awk '{ print $2 }' "${duc_output}" | while read jail; do
stat --format=%Y "/backup/jails/${jail}/var/log/lastlog" | xargs -i -n1 date -d "@{}" "+%d-%m-%Y" >> "${stat_output}"
get_inc "${jail}" >> "${incs_output}"
inc=0
if [ -f "${CONFDIR}/${jail}" ]; then
day=$(grep -c "day" "${CONFDIR}/${jail}")
month=$(grep -c "month" "${CONFDIR}/${jail}")
inc="${day}/${month}"
fi
echo "${inc}" >> "${incs_output}"
done
paste "${duc_output}" "${incs_output}" "${stat_output}" | awk '{ printf("%- 30s %- 10s %- 10s %- 15s\n", $2, $1, $3, $4); }'

View file

@ -12,7 +12,12 @@ if [ ! -n "${jail}" ]; then
fi
check_jail "${jail}" || error "${jail} : inexistant jail ! Use '$0 status' for list all"
inc=$(get_inc "${jail}")
inc="0"
if [ -f "${CONFDIR}/${jail}" ]; then
day=$(grep -c "day" "${CONFDIR}/${jail}")
month=$(grep -c "month" "${CONFDIR}/${jail}")
inc="${day}/${month}"
fi
if ( check_jail_on "${jail}" ); then
status="ON "
else

View file

@ -20,14 +20,3 @@ check_jail_on() {
fi
return "${return}"
}
get_inc() {
jail="${1}"
inc="0"
if [ -f "${CONFDIR}/${jail}" ]; then
day=$(grep -c "day" "${CONFDIR}/${jail}")
month=$(grep -c "month" "${CONFDIR}/${jail}")
inc="${day}/${month}"
fi
echo "${inc}"
}