Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/periodic/periodic.sh
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
fi | fi | ||||
if [ $# -ne 2 ]; then | if [ $# -ne 2 ]; then | ||||
usage | usage | ||||
fi | fi | ||||
shift | shift | ||||
arg=$1 | arg=$1 | ||||
if [ -z "$PERIODIC_ANTICONGESTION_FILE" ] ; then | |||||
export PERIODIC_ANTICONGESTION_FILE=`mktemp ${TMPDIR:-/tmp}/periodic.anticongestion.XXXXXXXXXX` | |||||
fi | |||||
if tty > /dev/null 2>&1; then | |||||
export PERIODIC_IS_INTERACTIVE=1 | |||||
fi | |||||
tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XXXXXXXXXX` | tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XXXXXXXXXX` | ||||
context="$PERIODIC" | context="$PERIODIC" | ||||
export PERIODIC="$arg${PERIODIC:+ }${PERIODIC}" | export PERIODIC="$arg${PERIODIC:+ }${PERIODIC}" | ||||
# Execute each executable file in the directory list. If the x bit is not | # Execute each executable file in the directory list. If the x bit is not | ||||
# set, assume the user didn't really want us to muck with it (it's a | # set, assume the user didn't really want us to muck with it (it's a | ||||
# README file or has been disabled). | # README file or has been disabled). | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | if [ $empty = TRUE ]; then | ||||
fi | fi | ||||
else | else | ||||
echo "" | echo "" | ||||
echo "-- End of $arg output --" | echo "-- End of $arg output --" | ||||
fi | fi | ||||
} | output_pipe $arg "$context" | } | output_pipe $arg "$context" | ||||
rm -f $tmp_output | rm -f $tmp_output | ||||
rm -f $PERIODIC_ANTICONGESTION_FILE |