This commit is contained in:
Marc Beninca 2023-10-03 11:07:38 +02:00
parent 71f0ef0856
commit afc8c6c833

View file

@ -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