4
%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
22
%%% Description: THIS MODULE IS DEPRECATD AND SHOULD BE REMOVED IN R14
26
-export([connect/1, connect/2, connect/3]).
27
-deprecated({connect, 1, next_major_release}).
28
-deprecated({connect, 2, next_major_release}).
29
-deprecated({connect, 3, next_major_release}).
32
-include("ssh_connect.hrl").
34
-define(default_timeout, 10000).
36
%%% Backwards compatibility
40
connect(Host, Opts) when is_list(Host) ->
41
connect(Host, 22, Opts);
43
Timeout = proplists:get_value(connect_timeout, Opts, ?default_timeout),
46
connect(Host, Port, Opts) ->
47
case ssh:connect(Host, Port, Opts) of
49
session(CM, proplists:get_value(connect_timeout,
50
Opts, ?default_timeout));
55
session(CM, Timeout) ->
56
case ssh_connection:session_channel(CM, Timeout) of
58
Args = [{channel_cb, ssh_shell},
59
{init_args,[CM, ChannelId]},
60
{cm, CM}, {channel_id, ChannelId}],
61
{ok, State} = ssh_channel:init([Args]),
62
ssh_channel:enter_loop(State);