Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tails
tails
Commits
8da38987
Commit
8da38987
authored
Sep 03, 2011
by
Tails developers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import htpdate (commit ba7f0b9) that allows setting wget's --dns-timeout.
parent
5f6d57b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
config/chroot_local-includes/usr/local/sbin/htpdate
config/chroot_local-includes/usr/local/sbin/htpdate
+8
-4
No files found.
config/chroot_local-includes/usr/local/sbin/htpdate
View file @
8da38987
...
...
@@ -2,7 +2,7 @@
#
# htpdate time poller version 0.9.3
# Copyright (C) 2005 Eddy Vervest
# Copyright (C) 2010 Tails dev
team <amnesia
@boum.org>
# Copyright (C) 2010
-2011
Tails dev
elopers <tails
@boum.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
...
...
@@ -52,8 +52,9 @@ my $set_date = 1;
my
$ssl_protocol
=
'
TLSv1
';
# will be passed to wget's --secure-protocol
my
$useragent
=
"
htpdate/
$VERSION
";
my
$userid
=
'';
# userid for proxy servers
my
$dns_timeout
;
our
(
$opt_d
,
$opt_h
,
$opt_q
,
$opt_x
,
$opt_u
,
$opt_a
,
$opt_f
,
$opt_l
,
$opt_p
);
our
(
$opt_d
,
$opt_h
,
$opt_q
,
$opt_x
,
$opt_u
,
$opt_a
,
$opt_f
,
$opt_l
,
$opt_p
,
$opt_t
);
sub
message
{
my
@msg
=
@_
;
...
...
@@ -81,7 +82,7 @@ sub error (@_) {
sub
parseCommandLine
()
{
# specify valid switches
getopts
('
dhqxfpu:a:l:
')
||
usage
();
getopts
('
dhqxfpu:a:l:
t:
')
||
usage
();
usage
()
if
$opt_h
;
usage
()
unless
$ARGV
[
0
];
...
...
@@ -94,6 +95,7 @@ sub parseCommandLine () {
$paranoid
=
1
if
$opt_p
;
$quiet
=
1
if
$opt_q
;
$set_date
=
0
if
$opt_x
;
$dns_timeout
=
$opt_t
if
$opt_t
;
my
@urls
;
foreach
my
$url
(
@ARGV
)
{
...
...
@@ -111,7 +113,7 @@ sub usage () {
print
STDERR
<<USAGE;
htpdate version $VERSION
Usage: $0 [-dhqxf] [-u userid] [-a useragent] <URL> [<URL> ...]
Usage: $0 [-dhqxf] [-u userid] [-a useragent]
[-t dns_timeout]
<URL> [<URL> ...]
-d debug
-h show this help
...
...
@@ -122,6 +124,7 @@ Usage: $0 [-dhqxf] [-u userid] [-a useragent] <URL> [<URL> ...]
-f request the full page and referenced resources rather than only its header
-l log to this file rather than to STDOUT
-p paranoid mode: don't set time unless all servers could be reached
-t DNS timeout for wget
e.g. $0 -x http://www.microsoft.com/ https://check.torproject.org/
...
...
@@ -174,6 +177,7 @@ sub getRemoteDateDiff {
'
--no-directories
',
'
--secure-protocol
',
$ssl_protocol
,
);
push
@wget_options
,
('
--dns-timeout
',
$dns_timeout
)
if
defined
$dns_timeout
;
push
@wget_options
,
('
--directory-prefix
',
$tmpdir
);
if
(
$fullrequest
)
{
push
@wget_options
,
('
--page-requisites
',
'
--span-hosts
');
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment