committed by
cbutler
2 changed files with 19 additions and 20 deletions
@ -1,9 +1,9 @@ |
|||||
FROM node:boron-alpine |
FROM node:boron-alpine |
||||
|
MAINTAINER butlerx@notthe.cloud |
||||
WORKDIR /app |
WORKDIR /app |
||||
RUN adduser -D -h /home/term -s /bin/sh term &&\ |
RUN adduser -D -h /home/term -s /bin/sh term && \ |
||||
echo "term:term" | chpasswd |
echo "term:term" | chpasswd |
||||
EXPOSE 3000 |
EXPOSE 3000 |
||||
ADD . /app |
COPY . /app |
||||
RUN apk add --update build-base python perl openssh &&\ |
RUN apk add --update build-base python openssh && yarn |
||||
yarn |
|
||||
CMD yarn start |
CMD yarn start |
||||
|
@ -1,16 +1,15 @@ |
|||||
#!/usr/bin/env perl |
#!/usr/bin/env sh |
||||
|
|
||||
my $user_at_address = $ARGV[0]; |
userAtAddress="$1" |
||||
my @u_a = split(/@/, $user_at_address); |
USER=$(echo "$userAtAddress" | cut -d"@" -f1); |
||||
if (defined $u_a[1]) { |
HOST=$(echo "$userAtAddress" | cut -d"@" -f2); |
||||
if ( $^O == 'linux' ) { |
|
||||
exec ("/usr/bin/ssh $u_a[0]\@$u_a[1]"); |
if [ "$USER" = "$HOST" ] |
||||
} |
then |
||||
} else { |
printf "Enter your username: " |
||||
print "Enter your username: "; |
read -r USER |
||||
my $username = <STDIN>; |
USER=$(echo "${USER}" | tr -d '[:space:]') |
||||
chomp ( $username ); |
ssh "$USER"@"$HOST" |
||||
if ( $^O == 'linux' ) { |
else |
||||
exec ("/usr/bin/ssh $username\@$u_a[0]"); |
ssh "$userAtAddress" |
||||
} |
fi |
||||
} |
|
||||
|
Loading…
Reference in new issue