From f332104d12f3a672f3920c208be732360b6d9153 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 13 Nov 2024 12:03:00 +0100 Subject: [PATCH] main_get_root --- bash/main.sh | 4 +++- bash/rescue.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bash/main.sh b/bash/main.sh index c12cdf8..5237bd3 100644 --- a/bash/main.sh +++ b/bash/main.sh @@ -2,7 +2,9 @@ MAIN_USERS_FILE="$(realpath --canonicalize-existing "${BASH_SOURCE[0]}")" -MAIN_USERS_ROOT="$(dirname "${MAIN_USERS_FILE}")" +main_get_root() { + dirname "${MAIN_USERS_FILE}" +} main_link_bashrc() { local file="/etc/bash.bashrc" diff --git a/bash/rescue.sh b/bash/rescue.sh index e7ff374..0d14bbd 100644 --- a/bash/rescue.sh +++ b/bash/rescue.sh @@ -85,7 +85,7 @@ rescue_upload() { "${user_host}" # upload root rsync --delete --recursive \ - "${MAIN_USERS_ROOT}/" "${user_host}:/etc/bash/" + "$(main_get_root)/" "${user_host}:/etc/bash/" # call setup # TODO variable ssh "${user_host}" -- "\