diff --git a/bin/qemush b/bin/qemush index e0a8b1d..4e972f2 100755 --- a/bin/qemush +++ b/bin/qemush @@ -21,7 +21,6 @@ perror() { # Function to show the usage public_help() { - local name name=$(basename "$0") exec cat << EOF @@ -111,7 +110,7 @@ public_diskls() { # Edit a virtual machine entrypoint with a text editor public_edit() { - local file="launchers/${1}" + file="launchers/${1}" # I don't even know why shellcheck gives me this warning # shellcheck disable=2209 [ -z "$EDITOR" ] && EDITOR=vi @@ -149,16 +148,15 @@ public_add() { trap return EXIT set -e - local name if [ -n "$2" ]; then name="$2" else name=$(basename "$1") fi - name="${HOME}/launchers/${name}" + destination="${HOME}/launchers/${destination}" - cp -vi -- "$1" "$name" - chmod 740 "$name" + cp -vi -- "$1" "$destination" + chmod 0740 -- "$destination" set +e trap - EXIT