HEX
Server: nginx/1.29.3
System: Linux mail.sarafai.ru 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: root (0)
PHP: 7.4.33
Disabled: dl,exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: //usr/sbin/opendmarc-importstats
#!/bin/sh
##
## Copyright (c) 2012, The Trusted Domain Project.  All rights reserved.
##
## opendmarc-importstats -- import opendmarc output to MySQL
##
## This is intended to be used via a crontab.  If import is successful,
## this code exits quietly so there's no output.  If it fails, it does
## "ls -l" on the temporary file, so that cron generates mail to whever
## ran the job.

## setup
statsdb="`grep ^HistoryFile /etc/opendmarc.conf | sed 's/^HistoryFile\s\+//'`"
[ -z "$statsdb" ] && exit 0
# OPENDMARC_PASSWORD="password"; export OPENDMARC_PASSWORD

if [ -s "$statsdb" ]
then
	mv "$statsdb" "${statsdb}.OLD.$$"

	if opendmarc-import < "${statsdb}.OLD.$$"
	then
		rm "${statsdb}.OLD.$$"
	else
		ls -l "${statsdb}.OLD.$$"
	fi
fi