You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
394 B
15 lines
394 B
import { isUndefined } from 'lodash';
|
|
|
|
const getRemoteAddress = (remoteAddress: string): string =>
|
|
isUndefined(remoteAddress.split(':')[3])
|
|
? 'localhost'
|
|
: remoteAddress.split(':')[3];
|
|
|
|
export default function loginOptions(
|
|
command: string,
|
|
remoteAddress: string
|
|
): string[] {
|
|
return command === 'login'
|
|
? [command, '-h', getRemoteAddress(remoteAddress)]
|
|
: [command];
|
|
}
|
|
|