2.2_tmp_nodev.sh

This commit is contained in:
thibault.dewailly
2016-04-04 15:05:10 +02:00
parent 5effa3335e
commit b079798e62
7 changed files with 183 additions and 31 deletions

View File

@ -1,6 +1,26 @@
# CIS Debian 7 Hardening common functions
#
# File Backup functions
#
backup_file() {
FILE=$1
if [ ! -f $FILE ]; then
crit "Cannot backup $FILE, it's not a file"
FNRET=1
else
TARGET=$(echo $FILE | sed -s 's/\//./g' | sed -s 's/^.//' | sed -s "s/$/.$(date +%F-%T)/" )
TARGET="$BACKUPDIR/$TARGET"
debug "Backuping $FILE to $TARGET"
cp -a $FILE $TARGET
FNRET=0
fi
}
#
# Logging functions
#
case $LOGLEVEL in
error )