Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Webtools Releng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
webtools
Releng
Webtools Releng
Commits
c6a6b1fb
Commit
c6a6b1fb
authored
16 years ago
by
david_williams
Browse files
Options
Downloads
Patches
Plain Diff
misc utility scripts
parent
7d692f4e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/org.eclipse.wtp.releng.tools/examplebinscripts/checkMirrors.sh
+55
-7
55 additions, 7 deletions
...clipse.wtp.releng.tools/examplebinscripts/checkMirrors.sh
with
55 additions
and
7 deletions
plugins/org.eclipse.wtp.releng.tools/examplebinscripts/checkMirrors.sh
+
55
−
7
View file @
c6a6b1fb
...
...
@@ -14,8 +14,8 @@
function
usage
()
{
printf
"
\n\t
Simple script to count number of mirrors available for a particular URL"
>
&2
printf
"
\n\t
Usage: %s [-h] | [-v] [-f] [-p] urls"
$(
basename
$0
)
>
&2
printf
"
\n\t\t
%s"
"where h==help, v==verbose, f==only ftp mirrors, p==only http mirrors "
>
&2
printf
"
\n\t
Usage: %s [-h] | [-v] [-f] [-p]
[-t number]
urls"
$(
basename
$0
)
>
&2
printf
"
\n\t\t
%s"
"where h==help, v==verbose, f==only ftp mirrors, p==only http mirrors
, t==test against 'number'
"
>
&2
printf
"
\n\t\t
%s"
"and urls is space delimited list of URL parameters,"
>
&2
printf
"
\n\t\t
%s
\n
"
"such as /ganymede/releases/site.xml"
>
&2
}
...
...
@@ -39,15 +39,34 @@ function checkMirrorsForURL() {
fi
nMirrors
=
$(
wget
-q
-O
-
"http://www.eclipse.org/downloads/download.php?file=
${
mirrorURL
}
&format=xml
${
protocolarg
}
"
|
grep
\<
mirror
\
|
wc
-l
)
echo
" number of"
${
pword
}
"mirrors: "
${
nMirrors
}
" for"
${
mirrorURL
}
echo
" number of"
${
pword
}
"mirrors: "
${
nMirrors
}
" for"
${
mirrorURL
}
>
&2
echo
$nMirrors
}
function
minvalue
()
{
ref
=
$1
comp
=
$2
result
=
if
[
-z
$comp
]
then
result
=
$ref
else
if
[
$ref
-lt
$comp
]
then
result
=
$ref
else
result
=
$comp
fi
fi
echo
$result
}
urls
=
ftponly
=
0
httponly
=
0
protocol
=
while
getopts
'hvfp'
OPTION
while
getopts
'hvfp
t:
'
OPTION
do
case
$OPTION
in
h
)
usage
...
...
@@ -59,6 +78,8 @@ do
;;
v
)
verbose
=
1
;;
t
)
testNumber
=
$OPTARG
;;
?
)
usage
exit
2
;;
...
...
@@ -67,7 +88,7 @@ done
shift
$((
$OPTIND
-
1
))
urls
=
$*
urls
=
"
$@
"
if
[
$ftponly
==
1
]
then
...
...
@@ -89,14 +110,41 @@ then
echo
"urls: "
$urls
fi
minimumMirrors
=
if
[
"
${
urls
}
"
]
then
echo
for
mirrorURL
in
$urls
for
mirrorURL
in
$
{
urls
}
do
checkMirrorsForURL
$mirrorURL
$protocol
nm
=
$(
checkMirrorsForURL
$mirrorURL
$protocol
)
minimumMirrors
=
`
minvalue
$nm
$minimumMirrors
`
done
echo
else
usage
fi
if
[
-z
$testNumber
]
then
if
[
$verbose
]
then
echo
"no test mode"
fi
exit
0
else
fresult
=
$((
testNumber
-
minimumMirrors
))
if
[
$fresult
-le
0
]
then
if
[
$verbose
]
then
echo
"minimum mirrors was greater than or equal to criteria"
fi
exit
0
else
if
[
$verbose
]
then
echo
"minimum mirrors was not as large as criteria"
fi
exit
$fresult
fi
fi
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment