diff options
Diffstat (limited to 'bin/vm')
-rwxr-xr-x | bin/vm | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -29,6 +29,8 @@ help() { - up - down - status + - ls-remote + - download OS the name or prefix of the OS to be acted upon QEMU_OPTIONS command line options to be given verbatim to QEMU @@ -79,6 +81,14 @@ help() { $ qemu-img create -f qcow2 $XDG_STATE_HOME/vm/qemu/debian-amd64-headless.qcow2 32G $ vm -vG up debian -- -cdrom ~/Downloads/ISO/debian-11.5.0-amd64-netinst.iso + + + List images available on the remote, and download one of them: + + $ vm ls-remote + debian-i386-headless + fedora-aarch64-headless + $ vm download fedora-aarch64-headless EOF } @@ -144,6 +154,7 @@ shift $((OPTIND - 1)) +REMOTE='https://euandre.org/s/vm' QCOW_DIR="${XDG_STATE_HOME:-$HOME/.local/state}"/vm/qemu RUNDIR="${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}}/vm" LOGS="${XDG_LOG_HOME:-$HOME/.local/var/log}"/vm/vm.log @@ -335,6 +346,13 @@ case "$ACTION" in write_ssh_config ;; + ls-remote) + wget -qO- "$REMOTE"/vms.txt + ;; + download) + eval "$(assert-arg -- "$OS" 'OS')" + wget -cO "$QCOW_DIR/$OS" "$REMOTE"/qemu/"$OS" + ;; *) printf 'Unrecognized action: "%s".\n\n' "$ACTION" >&2 usage >&2 |