comment,rejigger

This commit is contained in:
Marc Beninca 2023-05-13 03:05:57 +02:00
parent b5c4c51ced
commit 6786a4ea2f

View file

@ -1,15 +1,5 @@
function ovh-rescue-setup { function ovh-rescue-setup {
# # apt / conf
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
#
echo -n "\ echo -n "\
Acquire::AllowInsecureRepositories False; Acquire::AllowInsecureRepositories False;
Acquire::AllowWeakRepositories False; Acquire::AllowWeakRepositories False;
@ -21,14 +11,27 @@ APT::Get::Show-Versions True;
Dir::Etc::SourceParts ''; Dir::Etc::SourceParts '';
Dpkg::Progress True; Dpkg::Progress True;
" > '/etc/apt/apt.conf' " > '/etc/apt/apt.conf'
# apt / sources
echo -n "\ echo -n "\
deb https://deb.debian.org/debian buster main contrib non-free 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-backports main contrib non-free
deb https://deb.debian.org/debian buster-updates 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 deb https://deb.debian.org/debian-security buster/updates main contrib non-free
" > '/etc/apt/sources.list' " > '/etc/apt/sources.list'
# # bash / rc
link_bashrc 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 { function ovh-rescue-install {
@ -49,17 +52,18 @@ function ovh-rescue-install {
'git' 'git'
'rsync' 'rsync'
) )
# # update catalog
apt-get update apt-get update
# #
export DEBIAN_FRONTEND='noninteractive' export DEBIAN_FRONTEND='noninteractive'
# # upgrade packages
apt-get upgrade --assume-yes apt-get upgrade --assume-yes
# # install packages
apt-get install --assume-yes "${packages[@]}" apt-get install --assume-yes "${packages[@]}"
# install backports
apt-get install --assume-yes \ apt-get install --assume-yes \
--target-release "${release}-backports" "${backports[@]}" --target-release "${release}-backports" "${backports[@]}"
# # clean cache
apt-get clean apt-get clean
} }
@ -69,9 +73,9 @@ if [ "${host}" ] ; then
local user='root' local user='root'
# #
local user_host="${user}@${host}" local user_host="${user}@${host}"
# # remove fingerprints
ssh-keygen -R "${host}" ssh-keygen -R "${host}"
# # copy ssh id
ssh-copy-id \ ssh-copy-id \
-o 'StrictHostKeyChecking=accept-new' \ -o 'StrictHostKeyChecking=accept-new' \
"${user_host}" "${user_host}"