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