This commit is contained in:
Marc Beninca 2024-11-11 16:48:26 +01:00
parent 7687037070
commit 33e823024c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,6 +1,6 @@
#! /usr/bin/env sh
ovh_rescue_configure() {
rescue_ovh_configure() {
local hostname="${1}"
local release="bookworm"
local package
@ -66,7 +66,7 @@ fr_FR.UTF-8 UTF-8
apt-get update
}
ovh_rescue_install() {
rescue_ovh_install() {
local package
local release="bookworm"
# update catalog
@ -108,7 +108,7 @@ ovh_rescue_install() {
done
}
ovh_rescue_upload() {
rescue_ovh_upload() {
local host="${1}"
local hostname="${2}"
if [ "${hostname}" ]; then
@ -127,11 +127,11 @@ ovh_rescue_upload() {
# call setup
# TODO variable
ssh "${user_host}" -- "\
source \"/etc/bash/main.sh\" ; ovh_rescue_configure \"${hostname}\""
source \"/etc/bash/main.sh\" ; rescue_ovh_configure \"${hostname}\""
# create session
ssh "${user_host}" -- byobu new-session -d
# send keys
ssh "${user_host}" -- byobu send-keys "ovh_rescue_install" "C-m"
ssh "${user_host}" -- byobu send-keys "rescue_ovh_install" "C-m"
# attach session
mosh "${user_host}" -- byobu attach-session
else
@ -140,7 +140,7 @@ source \"/etc/bash/main.sh\" ; ovh_rescue_configure \"${hostname}\""
fi
}
ovh_rescue_wipe_vle2_0_init() {
rescue_ovh_wipe_vle2_0_init() {
local device="/dev/sdb"
local passphrase
local unit="mib"
@ -210,12 +210,12 @@ ovh_rescue_wipe_vle2_0_init() {
cryptsetup luksOpen "${device}1" "crypt"
}
ovh_rescue_wipe_vle2_1_zero() {
rescue_ovh_wipe_vle2_1_zero() {
# crypt / zero
dd status="progress" if="/dev/zero" of="/dev/mapper/crypt" bs="1G"
}
ovh_rescue_wipe_vle2_2_make() {
rescue_ovh_wipe_vle2_2_make() {
local passphrase
# crypt / close
cryptsetup luksClose "crypt"
@ -256,7 +256,7 @@ ovh_rescue_wipe_vle2_2_make() {
"/media/crypt/swap"
}
ovh_rescue_wipe_vle2_3_close() {
rescue_ovh_wipe_vle2_3_close() {
umount "/media/boot"
umount "/media/crypt" &&
cryptsetup luksClose "crypt"