wei/sh/expire_time.sh

11 lines
286 B
Bash

#!/bin/bash
log_location="/home/xele/xele_md/bin/sse_md_l2_local1.log"
expire_time=$(grep expire_time "$log_location" | head -1 | grep -oP 'expire_time=\K\d+')
one_day_later=$(date -d "+3 day" +%Y%m%d)
if [ "$expire_time" -gt "$one_day_later" ]; then
echo '1'
else
echo '0'
fi