import moment from 'moment' ; import cfg from 'teleport/config' ; import { NodeToken , BashCommand } from './types' ; export default function makeNodeBashCmd ( token ) { const duration = moment ( new Date ( ) ) . diff ( token . expiry ) ; const expires = moment . duration ( duration ) . humanize ( ) ; const text = `sudo bash -c "$(curl -fsSL ${ cfg . getNodeScriptUrl ( token . id ) })"` ; return { text , expires , } ; }