aboutsummaryrefslogtreecommitdiff
path: root/rex
AgeCommit message (Collapse)AuthorFiles
2022-03-17Version 4.1HEADv4.1masterSergey Poznyakoff1
Document the rex group command.
2022-03-16rex group drop: check number of argumentsSergey Poznyakoff1
2019-11-29Fix documentationSergey Poznyakoff1
(the 'group' command is not yet documented)
2019-11-29New subcommands for rex groupSergey Poznyakoff1
rex group swap - swap two stack entries rex group drop - drop a stack entry The command rex group show takes new options: -a,-all, to show all stack entries, and -H,--hosts, to show hosts along with the host group name. The options are mutually exclusive.
2019-11-29BugfixSergey Poznyakoff1
* rex: Clear config(default,selected) in ::hostproc::prologue, after it has been properly initialized and its content copied to config(hosts).
2019-11-28rex group: initial implementationSergey Poznyakoff1
Selected hosts and host groups are kept on a stack. The host group on top of the stack is the current one. The 'rex group' command is provided to maintain the host group stack. It takes four subcommands: git push NAME push current group selection on stack and select NAME as a new host group git pop pop current hostgroup selection off stack git show display the currently selected host group (and, optionally, hosts in it) git select COMMAND create a temporary unnamed hostgroup from hosts on which COMMAND exits with 0 status and push it on stack
2019-11-22Fix improper dereferenceSergey Poznyakoff1
2017-10-31Add function for overriding the PTR record from the rc file.Sergey Poznyakoff1
* rex (config::hostname): New function. * rex.man8: Document it.
2016-10-13BugfixSergey Poznyakoff1
Prefix unrecognized messages obtained in the INIT state with "ssh HOSTNAME". Fix behavior of --ignore-hosts with legacy configuration.
2016-10-01Version 4.0release-4.0Sergey Poznyakoff1
2016-09-24BugfixesSergey Poznyakoff1
* rex (::getopt::parse): Initialize group_id and group_def Don't use dict lappend (add_host_key_list): Catch eventual errors (rex_command,rex_copy_to,rex_list): Move --ignore-hosts to group global
2016-09-24Add NEWS fileSergey Poznyakoff1
2016-09-24Minor fixesSergey Poznyakoff1
2016-09-23Remove leftover debugSergey Poznyakoff1
2016-09-23Further improvements of command-line and rc parsersSergey Poznyakoff1
Restore priority of command-line settings over the rc * rex (version): Raise to 3.91 (optiondef): New global array. (throw_config_error) (catch_config_error): New functions. (option_set): New function. (::getopt::parse): Rewrite. Instead of taking option groups as positional arguments, accept the -group option which defines an option group. It takes two arguments: group ID and a list of group definitions. Return a dictionary where preprocessed options can be found. Calling [::getopt::run dict id] will apply the options from group ID. (::getopt::run): Take two arguments: the parse dictionary returned by ::getopt::parse, and the ID of the option group to run. All uses updated. (rex_parse_cmdline): Use three option groups: initial, which is run before parsing anything else, global, which is parsed after sourcing main rc file, and mode, which is parsed after sourcing hostgroup rc. (::config::host): Append to the hostlist variable, instead of the legacy hosts, to avoid triggering the deprecation warning. (::config::locus): New function. (::config::*): Use ::config::locus for diagnostic purposes. (::config::read): Catch and process custom rex throws. (common_config_setup): Remove. (runcmd): Process password authentication for files passed with -D * rex.man8: Update.
2016-09-19Revamp rc file support.Sergey Poznyakoff1
While improving rc file support and making it (hopefully) more convenient, this commit alters the priority of rc ws. command line settings. This will be reverted in future commits. * rex (::getopt::parse): New option -postprocess. When given, supplies the name of a function to be called after parsing command line. The function returns a list of triplets: {option line file}, where option is a (list of) option and eventual argument, line and file give the location of the corresponding statement in the rc file. The list is then processed by calls to ::getopt::getopt, one call per option. (::config): Deprecate the old way of setting configuration variables. Provide functions for each particular setting, that make rc file look more or less like a traditional UNIX configuration file, while still providing possibility for using full strength of TCL. Catch and process syntax errors. (modetrans): New array. Translates various spellings of the mode argument to ensure config(mode) is set uniformly.
2016-09-17Minor fixSergey Poznyakoff1
2016-09-17Code cleanupSergey Poznyakoff1
* rex (::job): New namespace; provides functions for keeping track of the created ssh/scp jobs. (runcp,runcprev,runcmd,rex_login): Rewrite using job ensemble functions. (closeproc,transition): Remove. (add_host_key_list): Rewrite. (hostuser,hostpass): Fix interactive mode. (rexdbput): Bugfix
2016-09-17Take into account that ::pmres::resolve can return multiple valuesSergey Poznyakoff1
2016-09-16Improve error handling and reportingSergey Poznyakoff1
Use StrictHostKeyChecking=yes to avoid problems with eventual interactive prompts from ssh/scp. Use LogLevel=VERBOSE to correctly determine whether we succeeded in authenticating to the server. Catch error output from ssh/scp in INIT state. If any appears, reflect it on the standard error and mark error for that host. * README: Reword intro * rex (max_scp_retry_count): Remove config setting. (terror): Take optional argument -nosave. (warning): Pass -nosave in call to terror (hostpass): Throw error if no password defined. All uses updated. (runcp,runcmd): Force StrictHostKeyChecking=yes and LogLevel=VERBOSE. Catch state changes. Reflect on stderr whatever received in INIT state. Raise error state if anything was. (runcprev): Rewrite using state machine similar to runcp. (rex_login): Rewrite using state machine similar to runcmd. Catch errors. Honor -Z option and earlycmd settings. (closeproc): Log state transition. (transition): Log state transition. Call hook if defined. * rex.man8: Update.
2016-09-16Further improvement of tempfile creationSergey Poznyakoff1
* rex (tempfile): New function. (maketempfile): Rewrite using tempfile. Return channel ID. Store filename in an upvar. All uses changed.
2016-09-15Improve tempfile handlingSergey Poznyakoff1
* rex (maketempfile): Rewrite. Return {fd name}. All callers changed. (forgettempfile): New function. (rex_command,rex_copy_to) (rex_login): Remove calls to cleanup. (MAIN): Call cleanup here
2016-09-15Create temporary script if a pipeline or control flow statement is used in ↵Sergey Poznyakoff1
sudo mode. Earlier versions used to create a temporary script wherever a pipe symbol or whitespace had been found in the command line. This was an overkill, and was removed in ff1b746d. However, this approach is still needed, if a pipeline or shell control structure is passed as command in sudo mode. This commit restores it for such cases. Another way would be to run /bin/sh -c 'cmd', but that requires a careful preprocessing of cmd, so I prefer a temporary, at least for the time being. * rex (maketempfile): Register the created file in the global list for further removal before exiting. (editdb): Setting trap not needed now. (cleanup): Remove files listed in cleanup_files (ispipeline): New function (rex_command): Fall back to copy mode when passing what looks like a pipeline or control flow statement in sudo mode. (MAIN): Set trap.
2016-09-15Expand {N} within string arguments.Sergey Poznyakoff1
2016-09-14BugfixesSergey Poznyakoff1
* install: Fix missing dereference * rex (runcmd): Use -f option when cleaning up temporary directory.
2016-09-14Improve installerSergey Poznyakoff1
* install: Install packages * rc.tcl: Remove. * rex.exp: Rename back to rex * README: Update. * README-hacking: Update.
2016-08-29Switch to autotools framework for packaging and installing.Sergey Poznyakoff1
2016-08-29Fix -H and -X options.Sergey Poznyakoff1
Allow to use multiple hostnames (comma-delimited list). Improve docs.
2016-08-29Provide options for ignoring init files and host lists from the hostgroupsSergey Poznyakoff1
* rex: New options: -I (--ignore-hosts) and -q (--no-init-file). Normalize the config(option,*) namespace. * rex.8: Update.
2016-08-27Allow for trailing \r in earlycmdSergey Poznyakoff1
2016-08-27Support for zshSergey Poznyakoff1
New option -Z (--zsh-quirk) provides an ad-hoc way of coping with hosts running zsh. The earlycmd configuration setting provides a generalized way of doing so. * rex (hostearlycmd): New function. (-Z, --zsh-quirk): New option. (listgroups): Try to disable zsh/zle and reset password if no prompt has been detected within a timeout and -Z option is set. Send the earlycmd (if defined) upon seeing the first line of output. * rex.8: Document changes
2016-08-27Fix timeout handling in the main expect loopSergey Poznyakoff1
* rex (closeproc): Use upvar to access the sidlist. (runcmd): Use single expect loop. Fix the use of expect_out(spawn_id). This fixes the handling of timeout. Note that $config{program} is now invoked once for each successful job in the batch.
2016-08-26Use exit instead of logoutSergey Poznyakoff1
2016-08-26Mark -H (--host) option as taking argumentsSergey Poznyakoff1
2015-08-17BugfixesSergey Poznyakoff1
* rex (runcmd): Add missing sigil. Fix -X functionality in case when resolve returns multiple names/ips.
2015-08-17New options --no-resolve (-n), --exclude-host (-X)Sergey Poznyakoff1
* rex (config): Set option,resolve to 1 (::pmres::resolve): Cache results. (hostname): New function. (runcmd): Use [hostname] to print hostnames. * rex.8: Document new options.
2015-08-16BugfixSergey Poznyakoff1
* rex (runcp): Expect on all ids in sidlist
2015-08-14New option -b (--buffer-output).Sergey Poznyakoff1
Useful together with -j to prevent intermixing of output lines received from different servers.
2015-06-20Support parallel execution. New option -j, --jobs.Sergey Poznyakoff1
* rex (config): Initialize option,jobs to 1 (prusage): list new options (runcp,runcmd): first argument is the list of hosts (shortopts,longopts): New option: -j, --jobs (main): process hosts in bunches, $config(option,jobs) hosts per each * rex.8: Update.
2015-06-18Version 2.1Sergey Poznyakoff1
* Makefile: Update version number * rex (editdb): unlink temporary file on signal (runcmd): Don't print host header if no_host_header option is set. (longopts): New option --no-host-header * vpnc.exp: Minor change
2015-06-17Improve outputSergey Poznyakoff1
* rex: Raise version to 2.1 New option --prefix (-P). (runcmd): log_user setting depends only on the --log option. Revamp expect loop to process output line by line. Remove carriage returns before printing output lines. Optionally prefix output lines with the name of the host. * rex.8: Update.
2013-08-22Improve the --edit functionality.Sergey Poznyakoff1
* rex (ispasswd): New function (mkdbview,svdbview): Use ispasswd to select keys that should be encrypted. (dbchanged): New function. (editdb): Allow for nonexisting db file. Do not call whatnow if the database hasn't changed. (main); Use $usrconfdir/db as a default database. Create the directory if it does not exist, if the user confirms.
2013-06-11Fix various typosSergey Poznyakoff1
2013-05-05Minor changeSergey Poznyakoff1
2013-05-05Implement --copy-fromSergey Poznyakoff1
* rex: New option --copy-from. * rex.8: Manpage template.
2013-04-18Implement a DNS resolver.Sergey Poznyakoff1
* rex: Implement a simplistic DNS resolver. Use it when looking up host-specific keys in the database. * vpnc.exp (startvpnc): Ignore SIGHUP.
2013-02-18Bugfixes.Sergey Poznyakoff1
* rex: Change libpath (writedb): Use maketempfile to create a temporary file. (mkdbview,svdbview): Fix conditionals. (editdb): Add a global decl for env. * vpnc.exp (startvpnc): Set default value for pidfile.
2013-01-18Improve timeout and error handling.Sergey Poznyakoff1
* rex (terror): New function. Use it to report errors. (runcp,runcprev): Do not exit on errors. (runcmd): Handle "*\r" and "*\n" in the final expect to reset timeout. (main): Report errors at the end of the run. Return 2 to the shell if they occurred.
2013-01-17BugfixesSergey Poznyakoff1
* rex (rexdbget,rexdbput): Use info to test for the hostgroup option. (rexdbclr): Likewise. Also, unset both the qualified and unqualified key.
2013-01-16Bugfixes.Sergey Poznyakoff1
* rex (maketempfile): New function. (prusage): Sort options alphabetically. (editdb): Use maketempfile. Redirect streams in exec. (main): Use maketempfile.

Return to:

Send suggestions and report system problems to the System administrator.