function os

This commit is contained in:
gabrielsoltz
2019-06-06 21:04:40 +01:00
parent 40117ed5dd
commit 085dd338f4
3 changed files with 9 additions and 3 deletions

View File

@@ -76,6 +76,12 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
DAYS_TO=$((( $DATE_IN_DAYS - $TODAY_IN_DAYS )/60/60/24))
echo $DAYS_TO
}
get_date_previous_than_months()
{
MONTHS_TO_COMPARE=$1
DATE_BEFORE_MONTHS_TO_COMPARE=$(date -v -$(echo $MONTHS_TO_COMPARE)m '+%Y-%m-%d')
echo $DATE_BEFORE_MONTHS_TO_COMPARE
}
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
TEMP_REPORT_FILE=$(mktemp -t -p /tmp prowler.cred_report-XXXXXX)