From bee3710cde42b432500fe3d42f7a2dd1e2a321c1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 11 Nov 2024 14:40:55 +0100 Subject: [PATCH] upload --- bash/ovh-rescue.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/bash/ovh-rescue.sh b/bash/ovh-rescue.sh index d79616f..46f81cf 100644 --- a/bash/ovh-rescue.sh +++ b/bash/ovh-rescue.sh @@ -18,10 +18,14 @@ Dpkg::Progress True; " >"/etc/apt/apt.conf.d/apt.conf" # apt / sources printf "%s" "\ -deb https://deb.debian.org/debian ${release} main non-free-firmware contrib non-free -deb https://deb.debian.org/debian ${release}-backports main non-free-firmware contrib non-free -deb https://deb.debian.org/debian ${release}-updates main non-free-firmware contrib non-free -deb https://deb.debian.org/debian-security ${release}-security main non-free-firmware contrib non-free +deb https://deb.debian.org/debian \ +${release} main non-free-firmware contrib non-free +deb https://deb.debian.org/debian \ +${release}-backports main non-free-firmware contrib non-free +deb https://deb.debian.org/debian \ +${release}-updates main non-free-firmware contrib non-free +deb https://deb.debian.org/debian-security \ +${release}-security main non-free-firmware contrib non-free " >"/etc/apt/sources.list" # bash / rc main_link_bashrc @@ -106,7 +110,8 @@ ovh_rescue_install() { ovh_rescue_upload() { local host="${1}" - if [ "${host}" ]; then + local hostname="${2}" + if [ "${hostname}" ]; then local user="root" # local user_host="${user}@${host}" @@ -117,11 +122,12 @@ ovh_rescue_upload() { -o "StrictHostKeyChecking=accept-new" \ "${user_host}" # upload root - rsync --delete --recursive "${MAIN_BASH_ROOT}/" "${user_host}:/etc/bash/" + rsync --delete --recursive \ + "${MAIN_BASH_ROOT}/" "${user_host}:/etc/bash/" # call setup # TODO variable - ssh "${user_host}" -- \ - "source \"/etc/bash/main.sh\" ; ovh_rescue_configure \"${host}\"" + ssh "${user_host}" -- "\ +source \"/etc/bash/main.sh\" ; ovh_rescue_configure \"${hostname}\"" # create session ssh "${user_host}" -- byobu new-session -d # send keys