openmamba-makereport: translate any '/' chars in output filename to avoid failure when creating it

This commit is contained in:
Silvan Calarco 2013-08-16 10:41:15 +02:00
parent c3d4df7d42
commit 09dfa1dca9

View File

@ -2,7 +2,7 @@
#
# openmamba system report generation tool
#
# Copyright (c) 2008-2011 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2008-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
VERSION=20110807
@ -22,12 +22,9 @@ TEMPFILE=`tempfile`
SYSTEM_SERIAL_NUMBER=unknown
}
SYSTEM_MANUFACTURER=`echo $SYSTEM_MANUFACTURER | tr ' ' _`
SYSTEM_MANUFACTURER=`echo $SYSTEM_MANUFACTURER | tr '-' _`
SYSTEM_PRODUCT_NAME=`echo $SYSTEM_PRODUCT_NAME | tr ' ' _`
SYSTEM_PRODUCT_NAME=`echo $SYSTEM_PRODUCT_NAME | tr '-' _`
SYSTEM_SERIAL_NUMBER=`echo $SYSTEM_SERIAL_NUMBER | tr ' ' _`
SYSTEM_SERIAL_NUMBER=`echo $SYSTEM_SERIAL_NUMBER | tr '-' _`
SYSTEM_MANUFACTURER=`echo $SYSTEM_MANUFACTURER | tr ' ' _ | tr '-' _ | tr '/' _`
SYSTEM_PRODUCT_NAME=`echo $SYSTEM_PRODUCT_NAME | tr ' ' _ | tr '-' _ | tr '/' _`
SYSTEM_SERIAL_NUMBER=`echo $SYSTEM_SERIAL_NUMBER | tr ' ' _ | tr '-' _ | tr '/' _`
REPORTNAME="openmamba-report-$SYSTEM_MANUFACTURER-$SYSTEM_PRODUCT_NAME-$SYSTEM_SERIAL_NUMBER.txt"
@ -126,7 +123,7 @@ _EOF
}
echo "openmamba report generation tool $VERSION"
echo "Copyright (c) 2008-2011 by Silvan Calarco"
echo "Copyright (c) 2008-2013 by Silvan Calarco"
echo
[ $UID = 0 ] || {