Skip to content

Commit 6cc1ee1

Browse files
authored
Merge pull request #2220 from cdr/remote-install-5bc0
install.sh: Allow customizing remote shell for remote installation
2 parents 79443c1 + a0b7bf2 commit 6cc1ee1

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

install.sh

+19-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ${not_curl_usage-}
2424
Usage:
2525
2626
$arg0 [--dry-run] [--version X.X.X] [--method detect] \
27-
[--prefix ~/.local] [user@host]
27+
[--prefix ~/.local] [--rsh ssh] [user@host]
2828
2929
--dry-run
3030
Echo the commands for the install process without running them.
@@ -45,6 +45,9 @@ Usage:
4545
and the binary symlinked into ~/.local/bin/code-server
4646
To install system wide pass ---prefix=/usr/local
4747
48+
--rsh <bin>
49+
Specifies the remote shell for remote installation. Defaults to ssh.
50+
4851
- For Debian, Ubuntu and Raspbian it will install the latest deb package.
4952
- For Fedora, CentOS, RHEL and openSUSE it will install the latest rpm package.
5053
- For Arch Linux it will install the AUR package.
@@ -109,7 +112,8 @@ main() {
109112
VERSION \
110113
OPTIONAL \
111114
ALL_FLAGS \
112-
SSH_ARGS
115+
RSH_ARGS \
116+
RSH
113117

114118
ALL_FLAGS=""
115119
while [ "$#" -gt 0 ]; do
@@ -144,6 +148,13 @@ main() {
144148
--version=*)
145149
VERSION="$(parse_arg "$@")"
146150
;;
151+
--rsh)
152+
RSH="$(parse_arg "$@")"
153+
shift
154+
;;
155+
--rsh=*)
156+
RSH="$(parse_arg "$@")"
157+
;;
147158
-h | --h | -help | --help)
148159
usage
149160
exit 0
@@ -152,7 +163,7 @@ main() {
152163
shift
153164
# We remove the -- added above.
154165
ALL_FLAGS="${ALL_FLAGS% --}"
155-
SSH_ARGS="$*"
166+
RSH_ARGS="$*"
156167
break
157168
;;
158169
-*)
@@ -161,17 +172,18 @@ main() {
161172
exit 1
162173
;;
163174
*)
164-
SSH_ARGS="$*"
175+
RSH_ARGS="$*"
165176
break
166177
;;
167178
esac
168179

169180
shift
170181
done
171182

172-
if [ "${SSH_ARGS-}" ]; then
173-
echoh "Installing remotely with ssh $SSH_ARGS"
174-
curl -fsSL https://code-server.dev/install.sh | prefix "$SSH_ARGS" ssh "$SSH_ARGS" sh -s -- "$ALL_FLAGS"
183+
if [ "${RSH_ARGS-}" ]; then
184+
RSH="${RSH-ssh}"
185+
echoh "Installing remotely with $RSH $RSH_ARGS"
186+
curl -fsSL https://code-server.dev/install.sh | prefix "$RSH_ARGS" "$RSH" "$RSH_ARGS" sh -s -- "$ALL_FLAGS"
175187
return
176188
fi
177189

0 commit comments

Comments
 (0)