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 { function hetzner-rescue-configure {
local host="${1}" local hostname="${1}"
local package local package
local packages=( local packages=(
'mosh' 'mosh'
@ -29,7 +29,7 @@ deb https://deb.debian.org/debian-security bookworm-security main non-free-firmw
main_link_bashrc main_link_bashrc
mv .bashrc .bashrc.old mv .bashrc .bashrc.old
# host name # host name
hostname "${host}" hostname "${hostname}"
# locales # locales
echo -n "\ echo -n "\
en_US.UTF-8 UTF-8 en_US.UTF-8 UTF-8
@ -102,7 +102,8 @@ function hetzner-rescue-install {
function hetzner-rescue-upload { function hetzner-rescue-upload {
local host="${1}" local host="${1}"
if [ "${host}" ] ; then local hostname="${2}"
if [ "${hostname}" ] ; then
local user='root' local user='root'
# #
local user_host="${user}@${host}" local user_host="${user}@${host}"
@ -116,7 +117,7 @@ if [ "${host}" ] ; then
rsync --delete --recursive "${MAIN_BASH_ROOT}/" "${user_host}:/etc/bash/" rsync --delete --recursive "${MAIN_BASH_ROOT}/" "${user_host}:/etc/bash/"
# call setup # call setup
# TODO variable # 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 # create session
ssh "${user_host}" -- byobu new-session -d ssh "${user_host}" -- byobu new-session -d
# send keys # send keys