This commit is contained in:
Marc Beninca 2024-11-11 17:52:34 +01:00
parent d3a510ab38
commit 98c121d837
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 44 additions and 93 deletions

View file

@ -1,52 +1,3 @@
rescue_hetzner_install() {
local package
local release='bookworm'
local packages=(
# installed
'dmidecode' 'efibootmgr' 'pciutils' 'usbutils'
'parted' 'mdadm' 'cryptsetup-bin' 'lvm2'
'btrfs-progs' 'dosfstools'
'git' 'nano' 'python3' 'rsync' 'vim'
'file' 'htop' 'lsof' 'man-db' 'tree' 'uuid-runtime'
# install
'lshw'
'duperemove' 'squashfs-tools'
'grub-efi-amd64-bin' 'grub-pc-bin'
'libdigest-sha3-perl' 'micro'
'iotop'
'exa' 'ipcalc' 'lf' 'ncdu' 'nnn' 'ranger'
)
local backports=(
)
# update catalog
apt-get update
#
debian_disable_frontend
# upgrade packages
apt-get upgrade --assume-yes
#
apt_clean_cache
# install packages
for package in "${packages[@]}"; do
echo
echo "${package}"
apt-get install \
--assume-yes \
"${package}"
apt_clean_cache
done
# install backports
for package in "${backports[@]}"; do
echo
echo "${package}"
apt-get install \
--assume-yes \
--target-release "${release}-backports" \
"${package}"
apt_clean_cache
done
}
rescue_hetzner_upload() {
local host="${1}"
local hostname="${2}"
@ -70,7 +21,7 @@ source \"/etc/bash/main.sh\" ; rescue_configure \"${hostname}\""
# create session
ssh "${user_host}" -- byobu new-session -d
# send keys
ssh "${user_host}" -- byobu send-keys "rescue_hetzner_install" "C-m"
ssh "${user_host}" -- byobu send-keys "rescue_install" "C-m"
# attach session
mosh "${user_host}" -- byobu attach-session
else

View file

@ -1,45 +1,3 @@
rescue_ovh_install() {
local package
local release="bookworm"
# update catalog
apt-get update
# disable frontend
debian_disable_frontend
# upgrade packages
apt-get upgrade --assume-yes
# clean cache
apt_clean_cache
# install packages
set \
"man-db" \
"dmidecode" "efibootmgr" "lshw" "pciutils" "usbutils" \
"parted" "mdadm" "cryptsetup-bin" "lvm2" \
"btrfs-progs" "dosfstools" "duperemove" "squashfs-tools" \
"git" "micro" "nano" "python3" "rsync" "vim" \
"exa" "lf" "ncdu" "nnn" "ranger" "tree" \
"file" "htop" "iotop" "ipcalc" "libdigest-sha3-perl" "lsof"
for package in "${@}"; do
echo
echo "${package}"
apt-get install --assume-yes \
"${package}"
apt_clean_cache
done
# install backports
set \
"grub-pc-bin" \
\
"grub-efi-amd64-bin"
for package in "${@}"; do
echo
echo "${package}"
apt-get install --assume-yes \
--target-release "${release}-backports" \
"${package}"
apt_clean_cache
done
}
rescue_ovh_upload() {
local host="${1}"
local hostname="${2}"
@ -63,7 +21,7 @@ source \"/etc/bash/main.sh\" ; rescue_configure \"${hostname}\""
# create session
ssh "${user_host}" -- byobu new-session -d
# send keys
ssh "${user_host}" -- byobu send-keys "rescue_ovh_install" "C-m"
ssh "${user_host}" -- byobu send-keys "rescue_install" "C-m"
# attach session
mosh "${user_host}" -- byobu attach-session
else

View file

@ -63,3 +63,45 @@ fr_FR.UTF-8 UTF-8
# update catalog
apt-get update
}
rescue_install() {
local package
local release="bookworm"
# update catalog
apt-get update
# disable frontend
debian_disable_frontend
# upgrade packages
apt-get upgrade --assume-yes
# clean cache
apt_clean_cache
# install packages
set \
"man-db" \
"dmidecode" "efibootmgr" "lshw" "pciutils" "usbutils" \
"parted" "mdadm" "cryptsetup-bin" "lvm2" \
"btrfs-progs" "dosfstools" "duperemove" "squashfs-tools" \
"git" "micro" "nano" "python3" "rsync" "vim" \
"exa" "lf" "ncdu" "nnn" "ranger" "tree" \
"file" "htop" "iotop" "ipcalc" "libdigest-sha3-perl" "lsof"
for package in "${@}"; do
echo
echo "${package}"
apt-get install --assume-yes \
"${package}"
apt_clean_cache
done
# install backports
set \
"grub-pc-bin" \
\
"grub-efi-amd64-bin"
for package in "${@}"; do
echo
echo "${package}"
apt-get install --assume-yes \
--target-release "${release}-backports" \
"${package}"
apt_clean_cache
done
}