Kolla provides production-ready containers and deployment tools for operating OpenStack clouds
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
350 B

#!/bin/bash
file_path=$1
limit_seconds=$2
# if the file doesn't exist, return 1
if [ ! -f $file_path ]; then
echo "${file_path} does not exist for file modification check"
exit 1
fi
curr_time=$(date +%s)
last_mod=$(stat -c '%Y' $file_path)
limit_epoch=$(( curr_time-limit_seconds ))
if [ ${limit_epoch} -gt ${last_mod} ]; then
exit 1
fi