From 6786a4ea2f2e2001fb35fa6ab1ee2ca34a5a4401 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 13 May 2023 03:05:57 +0200 Subject: [PATCH] comment,rejigger --- bash/ovh-rescue.sh | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/bash/ovh-rescue.sh b/bash/ovh-rescue.sh index 8823ba1..c374972 100644 --- a/bash/ovh-rescue.sh +++ b/bash/ovh-rescue.sh @@ -1,15 +1,5 @@ function ovh-rescue-setup { - # - echo -n 'ovh' > '/etc/hostname' - # - echo -n "\ -en_US.UTF-8 UTF-8 -fr_FR.UTF-8 UTF-8 -" > '/etc/locale.gen' - rm --force '/usr/share/locale/locale.alias' - ln --symbolic '/etc/locale.alias' '/usr/share/locale/locale.alias' - locale-gen - # + # apt / conf echo -n "\ Acquire::AllowInsecureRepositories False; Acquire::AllowWeakRepositories False; @@ -21,14 +11,27 @@ APT::Get::Show-Versions True; Dir::Etc::SourceParts ''; Dpkg::Progress True; " > '/etc/apt/apt.conf' + # apt / sources echo -n "\ deb https://deb.debian.org/debian buster main contrib non-free deb https://deb.debian.org/debian buster-backports main contrib non-free deb https://deb.debian.org/debian buster-updates main contrib non-free deb https://deb.debian.org/debian-security buster/updates main contrib non-free " > '/etc/apt/sources.list' - # + # bash / rc link_bashrc + # host name + echo -n 'ovh' > '/etc/hostname' + # locales + echo -n "\ +en_US.UTF-8 UTF-8 +fr_FR.UTF-8 UTF-8 +" > '/etc/locale.gen' + # fix alias + rm --force '/usr/share/locale/locale.alias' + ln --symbolic '/etc/locale.alias' '/usr/share/locale/locale.alias' + # generate locales + locale-gen } function ovh-rescue-install { @@ -49,17 +52,18 @@ function ovh-rescue-install { 'git' 'rsync' ) - # + # update catalog apt-get update # export DEBIAN_FRONTEND='noninteractive' - # + # upgrade packages apt-get upgrade --assume-yes - # + # install packages apt-get install --assume-yes "${packages[@]}" + # install backports apt-get install --assume-yes \ --target-release "${release}-backports" "${backports[@]}" - # + # clean cache apt-get clean } @@ -69,9 +73,9 @@ if [ "${host}" ] ; then local user='root' # local user_host="${user}@${host}" - # + # remove fingerprints ssh-keygen -R "${host}" - # + # copy ssh id ssh-copy-id \ -o 'StrictHostKeyChecking=accept-new' \ "${user_host}"