diff options
-rw-r--r-- | bash_include | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bash_include b/bash_include index b146d35..8561a65 100644 --- a/bash_include +++ b/bash_include @@ -289,7 +289,7 @@ function check_dmesg () do PREVIOS_DMESG_BUF="$DMESG_BUF" DMESG_BUF="`dmesg`" - [ "$PREVIOS_DMESG_BUF" '!=' "$DMESG_BUF" ] && [ "$FIRST_RUN" = "4" ] && echo '===> system message buffer was modified <===' + [ "$PREVIOS_DMESG_BUF" '!=' "$DMESG_BUF" ] && [ "$FIRST_RUN" = "0" ] && echo '===> You should check the system message buffer <===' sleep $1 [ "$?" '!=' "0" ] && return 1 FIRST_RUN=0 @@ -305,7 +305,7 @@ function prehistory_backup () previoushistorycount=`cat "$historycountfile"` if [ "$currentcount" -lt "$previoushistorycount" ] then - printf "\e[1;31mWarning\e[m: Your $HISTFILE may be MODIFIED OR TRUNCATED BY OTHER PROGRAMS!\n" + printf "\e[1;31mWarning\e[m: Your $HISTFILE may be TRUNCATED OR OVERWRITTEN BY OTHER PROGRAMS!\n" printf "Note: \e[1;33m$currentcount\e[m < $previoushistorycount\n" echo "Your $historycountfile and $historybackupfile will not be overwritten until this problem is fixed." echo " 1. Check your $HISTFILE." @@ -729,7 +729,8 @@ function backup_file () j=$j+1 continue else - "${prefixlist[@]}" \cp "${arglist[$i]}" "$rootfilename.$j" + "${prefixlist[@]}" \cp -p "${arglist[$i]}" "$rootfilename.$j" + "${prefixlist[@]}" touch -r "${arglist[$i]}" "$rootfilename.$j" break fi done @@ -740,6 +741,7 @@ function backup_file () fi else "${prefixlist[@]}" \cp -p "${arglist[$i]}" "$rootfilename" + "${prefixlist[@]}" touch -r "${arglist[$i]}" "$rootfilename" fi i=$i+1 done |