diff options
Diffstat (limited to 'bin/debvm-run')
-rwxr-xr-x | bin/debvm-run | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/debvm-run b/bin/debvm-run index a4a0890..1019ac7 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -113,6 +113,7 @@ IMAGE=rootfs.ext4 GRAPHICAL= CMDLINE_APPEND= NETOPTS= +SSHPORT= nth_arg() { shift "$1" @@ -152,7 +153,7 @@ opt_netopt() { NETOPTS="$NETOPTS,$1" } opt_sshport() { - opt_netopt "hostfwd=tcp:127.0.0.1:$1-:22" + SSHPORT=$1 } while getopts :gi:s:-: OPTCHAR; do @@ -194,6 +195,10 @@ while getopts :gi:s:-: OPTCHAR; do done shift "$((OPTIND - 1))" +if test -n "$SSHPORT"; then + opt_netopt "hostfwd=tcp:127.0.0.1:$SSHPORT-:22" +fi + test -f "$IMAGE" || die "image '$IMAGE' not found" test -s "$IMAGE" || die "image '$IMAGE' is empty" |