From 8ff626784184f15753104f4ffdd6c935a8f44d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Abonnel?= Date: Sun, 6 Nov 2022 21:27:50 +0100 Subject: [PATCH] =?UTF-8?q?Transf=C3=A9rer=20les=20fichiers=20vers=20'ecol?= =?UTF-8?q?eA'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecoleA/01-install.sh | 7 +++++++ ecoleA/change_username.sh | 5 +++++ ecoleA/config-computer.sh | 6 ++++++ ecoleA/proxy.sh | 10 ++++++++++ ecoleA/update.sh | 11 +++++++++++ 5 files changed, 39 insertions(+) create mode 100644 ecoleA/01-install.sh create mode 100644 ecoleA/change_username.sh create mode 100644 ecoleA/config-computer.sh create mode 100644 ecoleA/proxy.sh create mode 100644 ecoleA/update.sh diff --git a/ecoleA/01-install.sh b/ecoleA/01-install.sh new file mode 100644 index 0000000..3e89b85 --- /dev/null +++ b/ecoleA/01-install.sh @@ -0,0 +1,7 @@ +#!/bin/bash +serveur=192.168.1.45 +curl $serveur/scripts/proxy.sh | sudo bash +curl $serveur/scripts/config-computer.sh | sudo bash +curl $serveur/scripts/update.sh | sudo bash +echo -e "\n [ INFO ] Il est recommande de redémarrer avec ''sudo reboot now''" + diff --git a/ecoleA/change_username.sh b/ecoleA/change_username.sh new file mode 100644 index 0000000..66a100a --- /dev/null +++ b/ecoleA/change_username.sh @@ -0,0 +1,5 @@ +#!/bin/bash +usermod -l aoste aosteadmin +usermod -d /home/aoste -m aoste +chfn -f aoste aoste +exit diff --git a/ecoleA/config-computer.sh b/ecoleA/config-computer.sh new file mode 100644 index 0000000..0671513 --- /dev/null +++ b/ecoleA/config-computer.sh @@ -0,0 +1,6 @@ +#!/bin/bash +loadkeys fr + +USER_DO=aoste +echo "$USER_DO ALL=(ALL:ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/010-$USER_DO-nopassword + diff --git a/ecoleA/proxy.sh b/ecoleA/proxy.sh new file mode 100644 index 0000000..63ba09e --- /dev/null +++ b/ecoleA/proxy.sh @@ -0,0 +1,10 @@ +#!/bin/usr +file_apt_proxy="/etc/apt/apt.conf.d/01proxy" +file_http_proxy="/etc/profile.d/proxy.sh" + +echo "Acquire::http::Proxy \"http://192.168.1.45:3142\";" > $file_apt_proxy + +echo "export HTTP_PROXY=\"http://192.168.1.45:3128\"" > $file_http_proxy +echo "export HTTPS_PROXY=\"http://192.168.1.45:3128\"" > $file_http_proxy +echo "export FTP_PROXY=\"http://192.168.1.45:3128\"" > $file_http_proxy + diff --git a/ecoleA/update.sh b/ecoleA/update.sh new file mode 100644 index 0000000..0849d67 --- /dev/null +++ b/ecoleA/update.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Suppression des kernels non utilisé +echo -e "\n [INFO] Kernel installé mais plus utilisé" +dpkg --list 'linux-image*' | grep ^ii | awk '{print $2}' | sort | egrep "[0-9]-generic" | head -n 3 | tr '\n' ' ' > list-kernel +echo -e "\n" + +apt update +apt -y upgrade +apt -y autoremove +do-release-upgrade +