This file is indexed.

/usr/sbin/gmt-coastline-download is in gmt-coast-low 1:2.1.1-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  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
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/bin/bash
#
# Copyright (C) 2008-2011 Francesco P. Lovergine <frankie@debian.org>
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, 
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
#

usage() { 
	echo "usage: $0 [high|full|high-full|low|all] [version]" 
}

set -e

if [ $(id -u) -ne 0 ]; then
	echo "Run this script as root"
	exit 1
fi

#
# Default is downloading the latest version available.
#
VERSION=""

if [ ! -z "$2" ]; then
		case "$2" in
			1.9)
				;&
			1.10)
				;&
			2.0)
				;&
			2.0.1)
				;&
			2.0.2)
				;&
			2.1.0)
				;&
			2.1.1)
				VERSION="$2"
				;;
			*)
				echo "Unknown version $2, assumed correct anyway"
				VERSION="$2"
				;;
		esac
fi

#
# Default is downloading both full and high res coast lines.
#
if [ $# -eq 0 ]; then
	COAST_LINES=high-full
else
	case "$1" in
		high-full)
			COAST_LINES=high-full
			;;
		high)
			COAST_LINES=high
			;;
		low)
			COAST_LINES=low
			;;
		full)
			COAST_LINES=full
			;;
		all)
			COAST_LINES=all
			;;
		help|-h|--help)
			usage
			exit 5
			;;
		*)
			echo "Unknown argument '$1'" && usage
			exit 4
			;;
	esac
fi

MIRROR[1]=ftp://ftp.soest.hawaii.edu/gmt
MIRROR[2]=ftp://ibis.grdl.noaa.gov/pub/gmt
MIRROR[3]=ftp://ftp.iris.washington.edu/pub/gmt
MIRROR[4]=ftp://ftp.iag.usp.br/pub/gmt
MIRROR[5]=ftp://ftp.geologi.uio.no/pub/gmt
MIRROR[6]=ftp://gd.tuwien.ac.at/pub/gmt
MIRROR[7]=ftp://ftp.scc.u-tokai.ac.jp/pub/gmt
MIRROR[8]=ftp://mirror.geosci.usyd.edu.au/pub/gmt

cat <<EOF

 This script downloads both high-resolution and full resolution coast lines
 for GMT (Generic Mapping Tools) and installs the resulting CDF files under 
 /usr/share/gmt/coast for use.

 Choose a mirror site (default 1, * marked sites maintain old versions too):

 1) ${MIRROR[1]}
 2) ${MIRROR[2]}
*3) ${MIRROR[3]}
 4) ${MIRROR[4]}
 5) ${MIRROR[5]}
 6) ${MIRROR[6]}
*7) ${MIRROR[7]}
 8) ${MIRROR[8]}

EOF

echo -n "Insert a mirror ID: "
read -n 1 mirror 

case "$mirror" in
	[1-8])  SITE=${MIRROR[$mirror]}
		;;
	*)      SITE=${MIRROR[1]}
		;;
esac

SHARE_DIR=/usr/share/gmt

if [ ! -d $SHARE_DIR ]; then
	echo "GMT target directory $SHARE_DIR not found"
	exit 2
fi

TMPDIR=`mktemp -t -d gmt-coast.XXXXXXXX` || exit 3

URL_HIGH="$SITE/GSHHS${VERSION}_high.tar.bz2"
URL_FULL="$SITE/GSHHS${VERSION}_full.tar.bz2"
if [ -x /usr/bin/wget ]; then
	GET_HIGH="wget --progress=bar -O$TMPDIR/GSHHS_high.tar.bz2 $URL_HIGH"
	GET_FULL="wget --progress=bar -O$TMPDIR/GSHHS_full.tar.bz2 $URL_FULL"
	else if [ -x /usr/bin/curl ]; then
		GET_HIGH="curl --progress-bar -o$TMPDIR/GSHHS_high.tar.bz2 $URL_HIGH"
		GET_FULL="curl --progress-bar -o$TMPDIR/GSHHS_full.tar.bz2 $URL_FULL"
	     fi
fi

echo $GET_HIGH && $GET_HIGH && tar xojvf $TMPDIR/GSHHS_high.tar.bz2 -C $SHARE_DIR/coast --strip 2 share/coast
echo $GET_FULL && $GET_FULL && tar xojvf $TMPDIR/GSHHS_full.tar.bz2 -C $SHARE_DIR/coast --strip 2 share/coast

rm -rf $TMPDIR

cat <<EOF

 Coast lines downloaded and installed under $SHARE_DIR/coast.

EOF

exit 0