Created
October 13, 2016 00:18
-
-
Save rsmudge/6c8383a5ef452fb9641703295e613847 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# port foreward alias in Beacon and SSH | |
# | |
# pull common code into a function | |
sub _portfwd { | |
if ($2 eq "stop") { | |
btask($1, "Tasked session to stop forward to $3"); | |
call("beacons.pivot_stop_port", $null, $3); | |
} | |
else { | |
btask($1, "Tasked session to forward $3 to $2 $+ : $+ $3"); | |
call("beacons.portfwd", $null, $1, $2, int($3)); | |
} | |
} | |
# beacons | |
beacon_command_register("portfwd", "create a port forward", "Synopsis: portfwd [stop|<host> <port>]\nCreate a port forward <team server>:<port> -> current beacon -> <host>:<port>"); | |
alias portfwd { | |
_portfwd($1, $2, $3); | |
} | |
# ssh sessions | |
ssh_command_register("portfwd", "create a port forward", "Synopsis: portfwd [stop|<host> <port>]\nCreate a port forward <team server>:<port> -> current beacon -> <host>:<port>"); | |
ssh_alias portfwd { | |
_portfwd($1, $2, $3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment