diff options
author | Hans Nilsson <[email protected]> | 2016-03-17 13:30:25 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2016-03-18 14:48:08 +0100 |
commit | cb6b4b6c4a307239a714f6137ec93accfad0bd76 (patch) | |
tree | fac7432f1ad5b1acf619c52d628eb05d7d7ace93 /lib | |
parent | e7ec2d06b5b7b26f7a00e3853e99ce6a00be2932 (diff) | |
download | otp-cb6b4b6c4a307239a714f6137ec93accfad0bd76.tar.gz otp-cb6b4b6c4a307239a714f6137ec93accfad0bd76.tar.bz2 otp-cb6b4b6c4a307239a714f6137ec93accfad0bd76.zip |
ssh: cleaning and add export decl in ssh_info
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ssh/src/ssh_info.erl | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/lib/ssh/src/ssh_info.erl b/lib/ssh/src/ssh_info.erl index 0a4bd7706b..652466c32b 100644 --- a/lib/ssh/src/ssh_info.erl +++ b/lib/ssh/src/ssh_info.erl @@ -25,15 +25,10 @@ -module(ssh_info). --compile(export_all). - -string() -> - Pid = spawn(fun init/0), - print(Pid), - Pid ! {get,self()}, - receive - {result,R} -> R - end. +-export([print/0, + print/1, + string/0 + ]). print() -> print(user). @@ -51,17 +46,6 @@ print(D) -> underline(D, "Server part", $=), print_servers(D), io__nl(D), - %% case os:type() of - %% {unix,_} -> - %% io__nl(), - %% underline("Linux part", $=), - %% underline("Listening"), - %% catch io__format(os:cmd("netstat -tpln")), - %% io__nl(), - %% underline("Other"), - %% catch io__format(os:cmd("netstat -tpn")); - %% _ -> ok - %% end, underline(D, "Supervisors", $=), walk_sups(D, ssh_sup), io__nl(D) @@ -70,6 +54,14 @@ print(D) -> io__format(D,"Ssh not found~n",[]) end. +string() -> + Pid = spawn(fun init/0), + print(Pid), + Pid ! {get,self()}, + receive + {result,R} -> R + end. + %%%================================================================ print_general(D) -> {_Name, Slogan, Ver} = lists:keyfind(ssh,1,application:which_applications()), @@ -118,7 +110,7 @@ print_system_sup(D, {Ref,Pid,supervisor,[ssh_subsystem_sup]}) when is_reference( is_pid(Pid) -> PrintChannels = fun(X) -> print_channels(D,X) end, lists:foreach(PrintChannels, supervisor:which_children(Pid)); -print_system_sup(D, {{ssh_acceptor_sup,LocalHost,LocalPort,Profile}, Pid, supervisor, [ssh_acceptor_sup]}) when is_pid(Pid) -> +print_system_sup(D, {{ssh_acceptor_sup,_LocalHost,_LocalPort,_Profile}, Pid, supervisor, [ssh_acceptor_sup]}) when is_pid(Pid) -> io__format(D, ?INDENT?INDENT"[Acceptor Pid ~p]~n",[Pid]). @@ -191,9 +183,6 @@ children(Pid) -> end. %%%================================================================ -underline(D, Str) -> - underline(D, Str, $-). - underline(D, Str, LineChar) -> Len = lists:flatlength(Str), io__format(D, '~s~n',[Str]), @@ -211,12 +200,6 @@ datetime() -> fmt_host_port({{A,B,C,D},Port}) -> io_lib:format('~p.~p.~p.~p:~p',[A,B,C,D,Port]); fmt_host_port({Host,Port}) -> io_lib:format('~s:~p',[Host,Port]). - - -nyi(D) -> - io__format(D,'Not yet implemented~n',[]), - nyi. - %%%################################################################ io__nl(D) when is_atom(D) -> io:nl(D); |