From 98c121d8374464a4fa440cfa44ec00f833a74290 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 11 Nov 2024 17:52:34 +0100 Subject: [PATCH] install --- bash/rescue-hetzner.sh | 51 +----------------------------------------- bash/rescue-ovh.sh | 44 +----------------------------------- bash/rescue.sh | 42 ++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 93 deletions(-) diff --git a/bash/rescue-hetzner.sh b/bash/rescue-hetzner.sh index 5b123ab..0af9723 100644 --- a/bash/rescue-hetzner.sh +++ b/bash/rescue-hetzner.sh @@ -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 diff --git a/bash/rescue-ovh.sh b/bash/rescue-ovh.sh index b44c5fd..a62ae4e 100644 --- a/bash/rescue-ovh.sh +++ b/bash/rescue-ovh.sh @@ -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 diff --git a/bash/rescue.sh b/bash/rescue.sh index 8b1bc32..2a716bd 100644 --- a/bash/rescue.sh +++ b/bash/rescue.sh @@ -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 +}