Skip to content

Commit

Permalink
update matlab api [skip ci]
Browse files Browse the repository at this point in the history
vers bump [skip ci]
  • Loading branch information
scivision committed Feb 17, 2019
1 parent 01c0c50 commit ba12212
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions findssh.m
@@ -1,8 +1,8 @@
function findssh(port, service, timeout, baseip)
function hosts = findssh(port, service, timeout)
%% FINDSSH find SSH or other servers on an IPv4 subnet
%
% must first do one-time install in Python 3.6 from Terminal:
% pip install -e .
% must first do one-time install in Python 3 from Terminal:
% python3 -m pip install -e .
%
% example (find all SSH servers on IPv4 subnet on Port 22):
% findssh()
Expand All @@ -12,17 +12,14 @@ function findssh(port, service, timeout, baseip)
if nargin < 1, port=22; end
if nargin < 2, service = ''; end
if nargin < 3, timeout = 0.1; end
if nargin < 4, baseip = ''; end


validateattributes(port, {'numeric'}, {'integer', 'nonnegative'})
validateattributes(service, {'string', 'char'}, {'scalartext'})
validateattributes(timeout, {'numeric'}, {'real', 'nonnegative'})
validateattributes(baseip, {'string', 'char'}, {'scalartext'})

% Matlab R2018b didn't like ThreadPoolExectutor
servers = py.findssh.run(uint16(port), service, timeout, baseip, true);
servers = py.findssh.main('', port, service, timeout);

hosts = cellfun(@char, cell(servers), 'uniformoutput', false);
disp(hosts)
end

end
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = findssh
version = 1.1.0.1
version = 1.2.0
author = Michael Hirsch, Ph.D.
url = https://github.com/scivision/findssh
description = find open servers on your IPv4 subnet, e.g. SSH
Expand Down

0 comments on commit ba12212

Please sign in to comment.