aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-10-31 12:16:42 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2017-10-31 12:16:42 +0200
commit1398d07799c988357630824eb2656ba26fce4a8d (patch)
tree4b31122ad219a30c652d3eb8dedbbc8c7c3cd073
parentd777de47b14d6919400f3359f9edad97096b9e11 (diff)
downloadrex-1398d07799c988357630824eb2656ba26fce4a8d.tar.gz
rex-1398d07799c988357630824eb2656ba26fce4a8d.tar.bz2
Add function for overriding the PTR record from the rc file.
* rex (config::hostname): New function. * rex.man8: Document it.
-rwxr-xr-xrex9
-rw-r--r--rex.man813
2 files changed, 18 insertions, 4 deletions
diff --git a/rex b/rex
index 1990587..234e75e 100755
--- a/rex
+++ b/rex
@@ -403,6 +403,11 @@ namespace eval ::pmres {
set dnscache($mode,$arg) $res
return $res
}
+
+ proc setname {mode arg val} {
+ variable dnscache
+ set dnscache($mode,$arg) $val
+ }
}
proc hostname {arg} {
@@ -2486,6 +2491,10 @@ namespace eval ::config {
lappend hostlist {*}$args
}
+ proc hostname {ip name} {
+ ::pmres::setname -ip $ip $name
+ }
+
proc ifmode {args} {
switch -- $::config(mode) {*}$args
}
diff --git a/rex.man8 b/rex.man8
index 14c440a..64c6cba 100644
--- a/rex.man8
+++ b/rex.man8
@@ -1,5 +1,5 @@
.\" This file is part of rex - a remote execution utility -*- nroff -*-
-.\" Copyright (C) 2012-2016 Sergey Poznyakoff
+.\" Copyright (C) 2012-2017 Sergey Poznyakoff
.\"
.\" Rex is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with Rex. If not, see <http://www.gnu.org/licenses/>.
-.TH REX 8 "September 24, 2016" "REX" "Rex User Reference"
+.TH REX 8 "October 31, 2017" "REX" "Rex User Reference"
.ds ET /etc
.SH NAME
rex \- remote execution utility
@@ -181,6 +181,11 @@ that purpose:
\fBhost\fR \fIHOSTNAME\fR [\fIHOSTNAME\fR...]
Adds the listed hostnames to the list of hosts.
.TP
+\fBhostname\fR \fIIP\fR \fINAME\fR
+Registers \fINAME\fR in DNS cache as a hostname for the IPv4
+address \fIIP\fR. This is useful if \fIIP\fR has no PTR record, or its
+PTR record is deemed unsutable for some reason.
+.TP
\fBifmode\fR \fB{\fR \fImode\fR \fIbody\fR [\fImode\fR \fIbody\fR...] \fB}\fR
Matches the current mode agains each of \fImode\fR arguments. As soon
as the match is found, the corresponding \fBbody\fR is evaluated.
@@ -1080,7 +1085,7 @@ Interaction with
poses considerable problems because it spits out enormous amounts of
escape sequences for colorization and other purposes, which makes it
next to impossible to write an efficient regular expression for
->recognizing command line prompts. To make matters even worse, it
+recognizing command line prompts. To make matters even worse, it
ignores any changes made by \fBstty\fR.
.PP
An ad-hoc way of coping with hosts running \fBzsh\fR is provided by
@@ -1225,7 +1230,7 @@ Sergey Poznyakoff
.SH "BUG REPORTS"
Report bugs to <gray+rex@gnu.org.ua>.
.SH COPYRIGHT
-Copyright \(co 2012\-2016 Sergey Poznyakoff
+Copyright \(co 2012\-2017 Sergey Poznyakoff
.br
.na
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

Return to:

Send suggestions and report system problems to the System administrator.