diff --git a/README.md b/README.md index 9da356c..99904cc 100644 --- a/README.md +++ b/README.md @@ -81,10 +81,16 @@ system wide. `first-free-port` is a small C program designed accordingly to the Unix philosophy to show in `stdout` the first free (not listening) TCP port -after `argv[1]`, or `argv[1]` if it is free. You can compile it and add -it to your `PATH` if you need to allocate ports to protocols like SPICE in -your launching scripts (example in `qemu/bin/*-spice`). Its source is in -`src` folder of this repository. +after `argv[1]`, or `argv[1]` if it is free. You will need it to allocate +ports to protocols like SPICE in your launching scripts (example in +`qemu/bin/*-spice`). + +Example `qemush` command to add the program to a local `qemu` `bin` folder +: + +```sh +qemush do 'mkdir ~/bin && cc -o "${_}/first-free-port" src/first-free-port.c' +``` ## Usage diff --git a/bin/qemush b/bin/qemush index c058e88..739c05d 100755 --- a/bin/qemush +++ b/bin/qemush @@ -12,9 +12,9 @@ exec_as() { exec_as qemu "$@" -bin="${HOME}/bin" +bin="${HOME}/launchers" images="${HOME}/images" -PATH="${bin}:${PATH}" +PATH="${bin}:${HOME}/bin:${PATH}" EDITOR="${EDITOR:-nvim}" alias ls='ls --color=auto' alias exec='exec ' @@ -47,6 +47,7 @@ ${name}: usage: ${name} shell - start a shell as user qemu ${name} help - show this help ${name} add [] - add a launching script + ${name} run - run shell input as user qemu EOF } @@ -122,6 +123,10 @@ public_add() { trap - EXIT } +public_run() { + sh -c "$*" +} + function="$1" shift diff --git a/qemu/bin/linux b/qemu/launchers/linux similarity index 100% rename from qemu/bin/linux rename to qemu/launchers/linux diff --git a/qemu/bin/linux-spice b/qemu/launchers/linux-spice similarity index 100% rename from qemu/bin/linux-spice rename to qemu/launchers/linux-spice diff --git a/qemu/bin/redox b/qemu/launchers/redox similarity index 100% rename from qemu/bin/redox rename to qemu/launchers/redox diff --git a/qemu/bin/redox-spice b/qemu/launchers/redox-spice similarity index 100% rename from qemu/bin/redox-spice rename to qemu/launchers/redox-spice diff --git a/qemu/bin/windows b/qemu/launchers/windows similarity index 100% rename from qemu/bin/windows rename to qemu/launchers/windows diff --git a/qemu/bin/windows-spice b/qemu/launchers/windows-spice similarity index 100% rename from qemu/bin/windows-spice rename to qemu/launchers/windows-spice