forked from mariadb-corporation/MaxScale
-
Notifications
You must be signed in to change notification settings - Fork 1
/
check-change-date
executable file
·55 lines (47 loc) · 1.05 KB
/
check-change-date
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# Copyright (c) 2020 MariaDB Corporation Ab
# Copyright (c) 2023 MariaDB plc, Finnish Branch
#
# Use of this software is governed by the Business Source License included
# in the LICENSE.TXT file and at www.mariadb.com/bsl11.
#
# Change Date: 2027-05-22
#
# On the date above, in accordance with the Business Source License, use
# of this software will be governed by version 2 or later of the General
# Public License.
#
function print_usage_and_exit
{
echo "check-change-date date"
echo
echo " date: The expected change date, e.g. 2023-01-01"
exit 1
}
function run
{
local date=$1
local files=`find . -type f`
for f in $files
do
fgrep -q "Change Date:" $f 2> /dev/null
if [ $? -eq 0 ]
then
fgrep -q "Change Date: $date" $f 2> /dev/null
if [ $? -ne 0 ]
then
echo "$f lacks expected Change Date."
fi
fi
done
}
function main
{
if [ $# -ne 1 ]
then
print_usage_and_exit
fi
run $1
}
main $*