diff options
author | Pavel Balaev <balaev@tarantool.org> | 2023-10-04 15:45:11 +0300 |
---|---|---|
committer | Pavel Balaev <balaev@tarantool.org> | 2023-10-04 15:45:11 +0300 |
commit | c19380af0603bb13259e5b7090de489429e29106 (patch) | |
tree | 04b834fe7d485df3f225beedaa19d7893a01b298 | |
parent | 3cd88b2b4e970b0bf51a687e0170cd5fd4897be4 (diff) |
sh: fix nonroot setup script
Search nemu.cfg in .config/nemu
-rwxr-xr-x | sh/setup_nemu_nonroot.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sh/setup_nemu_nonroot.sh b/sh/setup_nemu_nonroot.sh index 44fa9db..b566335 100755 --- a/sh/setup_nemu_nonroot.sh +++ b/sh/setup_nemu_nonroot.sh @@ -24,14 +24,22 @@ else echo "Couldn't find user home directory" >&2 exit 1 fi - if [ ! -f ${USER_DIR}/.nemu.cfg ]; then - echo "Couldn't find .nemu.cfg in user home directory" >&2 + + NEMU_CFG="" + if [ -f "${USER_DIR}/.nemu.cfg" ]; then + NEMU_CFG="${USER_DIR}/.nemu.cfg" + elif [ -f "${USER_DIR}/.config/nemu/nemu.cfg" ]; then + NEMU_CFG="${USER_DIR}/.config/nemu/nemu.cfg" + fi + + if [ -z $NEMU_CFG ]; then + echo "Couldn't find nemu.cfg in user home directory" >&2 exit 1 fi - QEMU_BIN_PATH=$(grep '^qemu_bin_path' ${USER_DIR}/.nemu.cfg | awk '{ printf "%s\n", $3 }') + QEMU_BIN_PATH=$(grep '^qemu_bin_path' $NEMU_CFG | awk '{ printf "%s\n", $3 }') if [ -z "$QEMU_BIN_PATH" ]; then - echo "Couldn't get qemu_bin_path from .nemu.cfg" >&2 + echo "Couldn't get qemu_bin_path from ${NEMU_CFG}" >&2 exit 1 fi fi |