Have mktemp(1) construct the temporary file name for us instead

of providing a template manually.

Submitted by:	Lars Eggert <larse@isi.edu>
This commit is contained in:
mtm 2003-06-30 22:06:26 +00:00
parent b8db4ad194
commit 016c135dba
7 changed files with 7 additions and 7 deletions

View File

@ -41,7 +41,7 @@ rc=0
case "$daily_status_security_ipfwdenied_enable" in case "$daily_status_security_ipfwdenied_enable" in
[Yy][Ee][Ss]) [Yy][Ee][Ss])
TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` TMP=`mktemp -t security`
if ipfw -a l 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then if ipfw -a l 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then
check_diff new_only ipfw ${TMP} "${host} ipfw denied packets:" check_diff new_only ipfw ${TMP} "${host} ipfw denied packets:"
fi fi

View File

@ -41,7 +41,7 @@ rc=0
case "$daily_status_security_ipfdenied_enable" in case "$daily_status_security_ipfdenied_enable" in
[Yy][Ee][Ss]) [Yy][Ee][Ss])
TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` TMP=`mktemp -t security`
if ipfstat -nhio 2>/dev/null | grep block > ${TMP}; then if ipfstat -nhio 2>/dev/null | grep block > ${TMP}; then
check_diff new_only ipf ${TMP} "${host} ipf denied packets:" check_diff new_only ipf ${TMP} "${host} ipf denied packets:"
fi fi

View File

@ -42,7 +42,7 @@ rc=0
case "$daily_status_security_ipfwlimit_enable" in case "$daily_status_security_ipfwlimit_enable" in
[Yy][Ee][Ss]) [Yy][Ee][Ss])
TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` TMP=`mktemp -t security`
IPFW_LOG_LIMIT=`sysctl -n net.inet.ip.fw.verbose_limit 2> /dev/null` IPFW_LOG_LIMIT=`sysctl -n net.inet.ip.fw.verbose_limit 2> /dev/null`
if [ $? -eq 0 ] && [ "${IPFW_LOG_LIMIT}" -ne 0 ]; then if [ $? -eq 0 ] && [ "${IPFW_LOG_LIMIT}" -ne 0 ]; then
ipfw -a l | grep " log " | \ ipfw -a l | grep " log " | \

View File

@ -41,7 +41,7 @@ rc=0
case "$daily_status_security_ip6fwdenied_enable" in case "$daily_status_security_ip6fwdenied_enable" in
[Yy][Ee][Ss]) [Yy][Ee][Ss])
TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` TMP=`mktemp -t security`
if ip6fw -a l 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then if ip6fw -a l 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then
check_diff new_only ip6fw ${TMP} "${host} ip6fw denied packets:" check_diff new_only ip6fw ${TMP} "${host} ip6fw denied packets:"
fi fi

View File

@ -42,7 +42,7 @@ rc=0
case "$daily_status_security_ip6fwlimit_enable" in case "$daily_status_security_ip6fwlimit_enable" in
[Yy][Ee][Ss]) [Yy][Ee][Ss])
TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` TMP=`mktemp -t security`
IP6FW_LOG_LIMIT=`sysctl -n net.inet6.ip6.fw.verbose_limit 2> /dev/null` IP6FW_LOG_LIMIT=`sysctl -n net.inet6.ip6.fw.verbose_limit 2> /dev/null`
if [ $? -eq 0 ] && [ "${IP6FW_LOG_LIMIT}" -ne 0 ]; then if [ $? -eq 0 ] && [ "${IP6FW_LOG_LIMIT}" -ne 0 ]; then
ip6fw -a l | grep " log " | \ ip6fw -a l | grep " log " | \

View File

@ -52,7 +52,7 @@ check_diff() {
msg="$1"; shift msg="$1"; shift
if [ "${tmpf}" = "-" ]; then if [ "${tmpf}" = "-" ]; then
tmpf=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` tmpf=`mktemp -t security`
cat > ${tmpf} cat > ${tmpf}
fi fi

View File

@ -38,7 +38,7 @@ motd_start()
case ${OSTYPE} in case ${OSTYPE} in
FreeBSD) FreeBSD)
T=`mktemp /tmp/_motd.XXXXXX` T=`mktemp -t motd`
uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T} awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T}
;; ;;