Use mdoc(7) instead of markdown #6
|
@ -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); }'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue