diff --git a/bin/qemush b/bin/qemush index 8c11e7c..a819e3f 100755 --- a/bin/qemush +++ b/bin/qemush @@ -14,9 +14,9 @@ exec_as() { exec_as qemu "$@" -bin=bin +bin="${HOME}/bin" images=images -PATH="./${bin}:${PATH}" +PATH="${bin}:${PATH}" EDITOR="${EDITOR:-nvim}" [ -t 1 ] && alias cat='source-highlight -o STDOUT -f esc' alias ls='ls --color=auto' @@ -44,6 +44,7 @@ ${name}: usage: ${name} diskrm - delete disk image ${name} shell - start a shell as user qemu ${name} help - show this help + ${name} add - add a launching script from this PATH EOF } @@ -108,6 +109,17 @@ public_cat() { exec cat "${bin}/${1}" } +public_add() { + trap return EXIT + set -e + cd - + local name="${2:-$(basename "$1")}" + cp -v -i -- "$1" "${bin}/${2}" + chmod 740 "${bin}/${name}" + set +e + trap - EXIT +} + function="$1" shift