Fix bug for 10.1.9 and modify apt_update_if_needed function.

This commit is contained in:
samson 2018-12-05 15:10:06 +08:00
parent 73c1e12910
commit 64ab792e6c
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ audit () {
does_pattern_exist_in_file $FILE $PATTERN
if [ $FNRET = 0 ]; then
ok "$PATTERN is present in $FILE"
check_password_by_pam $FILE $PAMLIBNAME $OPTIONNAME ge $CONDT_VAL
check_param_pair_by_pam $FILE $PAMLIBNAME $OPTIONNAME ge $CONDT_VAL
if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is $CONDT_VAL"
else

View File

@ -403,7 +403,7 @@ apt_update_if_needed()
then
UPDATE_AGE=$(( $(date +%s) - $(stat -c '%Y' /var/cache/apt/pkgcache.bin) ))
if [ $UPDATE_AGE -gt 21600 ]
if [ $UPDATE_AGE -gt 3600 ]
then
# update too old, refresh database
$SUDO_CMD apt-get update -y >/dev/null 2>/dev/null