1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Changed to a more secure way of handling tempfiles

This commit is contained in:
Finn Andersen 2014-10-30 09:56:25 +01:00
parent 31f5cc79db
commit 771fb2dd72

View file

@ -32,6 +32,7 @@ GPLv2
# #
# HISTORY # HISTORY
# v1.0 : Initial release # v1.0 : Initial release
# 1.0.1 : More secure handling of tempfiles
# #
############################################### ###############################################
# #
@ -115,7 +116,7 @@ esac
# Location and name of tempfile to parse # Location and name of tempfile to parse
FILENAME=/tmp/cisco_epc3010.dump FILENAME=$(mktemp /tmp/cisco_epc3010-XXXX.dump) || exit 1
# Get statuspage from the modem # Get statuspage from the modem
@ -130,7 +131,7 @@ UP_PWR_ARRAY=( 0 $(cat $FILENAME | grep " up_pwr" | awk -F "nowrap>| <script" '
# #
# Downstream info - Modem outputs both PowerLevels and Signal to Noise Ratio # Downstream info - Modem outputs both Power Levels and Signal to Noise Ratio
# #
if [ "$DIRECTION" == "downstream" ]; then if [ "$DIRECTION" == "downstream" ]; then
@ -152,7 +153,7 @@ fi
# #
# Upstream info - Modem outputs PowerLevels # Upstream info - Modem outputs Power Levels
# #
if [ "$DIRECTION" == "upstream" ]; then if [ "$DIRECTION" == "upstream" ]; then
@ -168,4 +169,6 @@ fi
# #
# Remove tempory file, used for parsing data # Remove tempory file, used for parsing data
# #
rm -f $FILENAME trap "rm -rf $FILENAME" EXIT