-
Notifications
You must be signed in to change notification settings - Fork 3
/
entrypoint.sh
executable file
·69 lines (63 loc) · 1.9 KB
/
entrypoint.sh
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
#
#
# (c) 2024 Valentino Lauciani <[email protected]>,
# Istituto Nazione di Geofisica e Vulcanologia.
#
#####################################################
# Import config file
. $(dirname $0)/config.sh
# Check leapsecond
if [ "$( id -u )" -eq 0 ]; then
qmerge -h 2> /dev/null > /dev/null
if (( ${?} != 0 )); then
wget -O /usr/local/etc/leapseconds http://www.ncedc.org/ftp/pub/programs/leapseconds
fi
fi
# Get remote version number and check update
VERSION_GITHUB=$( curl -s https://raw.githubusercontent.com/INGV/fdsnws-fetcher/master/publiccode.yml | grep "softwareVersion" | awk -F":" '{print $2}' | sed -e 's/^[[:space:]]*//' )
if [ "${VERSION}" != "${VERSION_GITHUB}" ]; then
echo ""
echo "############################################################################"
echo "# "
echo "# Your current version: ${VERSION}"
echo "# New available version: ${VERSION_GITHUB}"
echo "# "
echo "# Please, update your docker image running command below and try again!"
echo "# $ docker pull ingv/fdsnws-fetcher"
echo "#"
echo "############################################################################"
sleep 10
#exit 1
fi
### START - Check parameters ###
#echo "Print all input params:${@}"
IN__MODE=
while getopts :hm: OPTION
do
case ${OPTION} in
h)
usage_entrypoint
exit 1
;;
\?)
echo "Invalid option: -$OPTARG" >/dev/null
;;
:)
echo "Option -$OPTARG requires an argument." >&2
usage_entrypoint
exit 1
;;
esac
done
OPTIND=1
# Check input parameter
if [[ -z ${@} ]]; then
echo ""
echo " Please, give me an input params"
echo ""
usage_entrypoint
exit 1
fi
# run command
time ./01_find_stations.sh $@