File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ ssh_in() {
101
101
done
102
102
103
103
if [ -z " $server " ]; then
104
+ fallback_deprecated_ssh " $user " " $server " " $@ "
104
105
help ssh
105
106
exit
106
107
fi
@@ -121,11 +122,30 @@ ssh_in() {
121
122
fi
122
123
command ssh " ${ssh_remote} " -F " ${SSH_PLUGIN_CACHE_CONFIG} "
123
124
else
125
+ fallback_deprecated_ssh " $user " " $server " " $@ "
124
126
echo " Can't find server named $server "
125
127
exit 1
126
128
fi
127
129
}
128
130
131
+ # If ssh command is known as deprecated yet, fallback to docker exec
132
+ fallback_deprecated_ssh () {
133
+ if key_in_array " ssh" in DEPRECATED_COMMANDS; then
134
+
135
+ echo " Warning: Deprecated command. Please use led in to get console on container or install ssh plugin to connect servers."
136
+
137
+ # get command from remaining arguments
138
+ local user=${1:- " dev" }
139
+ shift
140
+ local server=${1:- " apache" }
141
+ shift
142
+ local cmd=${*:- $cmd }
143
+
144
+ _docker_exec " ${user} " " ${server} " " ${cmd} "
145
+ fi
146
+ return 0
147
+ }
148
+
129
149
# Generate single file with all ssh config files founds
130
150
ssh_do_cache () {
131
151
local sshconfig=(.led/sshconfig " ${HOME} " /.led/sshconfig " ${SCRIPT_DIR} " /etc/sshconfig)
You can’t perform that action at this time.
0 commit comments