From afc8c6c83365beea4d530eca1a0162170fc97e23 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 3 Oct 2023 11:07:38 +0200 Subject: [PATCH] hostname --- bash/hetzner-rescue.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bash/hetzner-rescue.sh b/bash/hetzner-rescue.sh index 8aae4d3..261c7e5 100644 --- a/bash/hetzner-rescue.sh +++ b/bash/hetzner-rescue.sh @@ -1,5 +1,5 @@ function hetzner-rescue-configure { -local host="${1}" +local hostname="${1}" local package local packages=( 'mosh' @@ -29,7 +29,7 @@ deb https://deb.debian.org/debian-security bookworm-security main non-free-firmw main_link_bashrc mv .bashrc .bashrc.old # host name - hostname "${host}" + hostname "${hostname}" # locales echo -n "\ en_US.UTF-8 UTF-8 @@ -102,7 +102,8 @@ function hetzner-rescue-install { function hetzner-rescue-upload { local host="${1}" -if [ "${host}" ] ; then +local hostname="${2}" +if [ "${hostname}" ] ; then local user='root' # local user_host="${user}@${host}" @@ -116,7 +117,7 @@ if [ "${host}" ] ; then rsync --delete --recursive "${MAIN_BASH_ROOT}/" "${user_host}:/etc/bash/" # call setup # TODO variable - ssh "${user_host}" -- "source '/etc/bash/main.sh' ; hetzner-rescue-configure '${host}'" + ssh "${user_host}" -- "source '/etc/bash/main.sh' ; hetzner-rescue-configure '${hostname}'" # create session ssh "${user_host}" -- byobu new-session -d # send keys