]> git.donarmstrong.com Git - bin.git/commitdiff
add slightly more useful documentation to ssh-sendmail
authorDon Armstrong <don@donarmstrong.com>
Tue, 6 Nov 2012 02:01:05 +0000 (02:01 +0000)
committerDon Armstrong <don@donarmstrong.com>
Tue, 6 Nov 2012 02:01:05 +0000 (02:01 +0000)
sshsendmail

index 815130294a656d32b82e34c1ba6e143402e2997e..89570950a3750b995dafd0ab61db1fd51724c7d8 100755 (executable)
@@ -21,14 +21,18 @@ sshsendmail - Uses ssh to send a mail message to a different machine's copy of s
 
 =head1 SYNOPSIS
 
-ss [options]
+Stick this command in /usr/lib/nullmailer/sshsendmail.
+
+Then add
+
+foohost.com sshsendmail --identity=/var/mail/.ssh/id_rsa --username remotemail --sendmail-options='-baruser@foohost.com'
+
+to /etc/nullmailer/remotes.
 
  Options:
-  --host, -H host to upload image to
-  --dir, -D dir to place image (on host of -H set)
-  --import-options, -I options to import (default -window root)
-  --convert-options, -C options to convert (for scaling)
-  --scale, -s make scaled image (default)
+  --identity, -i ssh identity to use to connect to the server
+  --username, -l remote username
+  --sendmail-options, -o options to pass to sendmail
   --debug, -d debugging level (Default 0)
   --help, -h display this help
   --man, -m display manual
@@ -84,12 +88,11 @@ my %options = (debug              => 0,
               host               => undef,
               identity           => undef,
               username           => undef,
-              log                => '/var/mail/log',
               'sendmail-options' => '',
              );
 
 GetOptions(\%options,'identity|i=s','username|l=s','daemon|d', 'syslog|s',
-          'sendmail-options|o=s','log|l=s',
+          'sendmail-options|o=s',
           'help|h|?','man|m');
 
 pod2usage() if $options{help};
@@ -137,19 +140,14 @@ if ($?) {
      exit (9);
 }
 my $ssh = new IO::Handle;
-my $log = new IO::File $options{log},'w+' or exit(2);
-print {$log} @message or exit(2);
-print {$log} join(' ',('ssh',@ssh_arguments)) or exit(2);
 open($ssh,'|-','ssh',@ssh_arguments) or exit(17);
 print {$ssh} @message or exit(17);
 close $ssh or exit(17);
 if ($?) {
      print STDERR "${0}: Failed: sendmail died for some reason\n";
-     print {$log} "${0}: Failed: sendmail died for some reason\n";
      exit (17);
 }
 else {
      print STDERR "${0}: Succeeded: Yeay\n";
-     print {$log} "${0}: Succeeded: Yeay\n";
      exit 0;
 }